0

This simple onlick event works in IE and Chrome but not in FireFox (latest version). Is there some syntax issue?

<html> 
<head> 
<script>
    function scroll() { 
        alert(1);
    }
</script>
</head> 
<body> 
<a href="#" onclick="javascript:scroll();" />Click Here</a>
</body> 
</html> 

Thanks in advance!

2
Contributors
5
Replies
18
Views
2 Years
Discussion Span
Last Post by DaveAmour
0

Actually it might be that you closed your a tag twice.

Remove the / at the end of the first part of the a tag.

0

Bingo - "scroll" must be a reserved word in FF. Thanks for your help.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.