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

    function scroll() { 
<a href="#" onclick="javascript:scroll();" />Click Here</a>

Thanks in advance!

Recommended Answers

All 5 Replies

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

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

Also it also seems FF doesn't like "scroll" - try renaming your function to something else.

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

You're welcome.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.