technoparkcorp
asked on
Opera onclick defect in JS?
Why this code doesn't work in Opera? And it works in all other browsers (IE, FF)
When the user clicks the button nothing happens. Why so?
When the user clicks the button nothing happens. Why so?
<form>
<input id="continue" type="button" value="Continue" onclick="ToContinue();" />
</form>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
why? What's wrong?
there a space between getElementById ('test')
^
there a space between getElementById ('test')
^
<html><body>
<form>
<input id="continue" type="button" value="Continue" onclick="ToContinue(); return false;" />
</form>
<span id="test">old</span>
<script type='text/javascript'>
<!--
function ToContinue () {
document.getElementById('test').innerHTML = 'new';
}
-->
</script>
</body></html>
Can you show the JS file and the html you ACTUALLY use?
Also you should comment out inline html comments in JS
Like this:
// -->
Also you should comment out inline html comments in JS
Like this:
// -->
ASKER
When I move the function to the script file, it doesn't work. What's wrong?
Open in new window