Internet Explorer <a href=””></a> JavaScript Links

by Nate on January 9, 2009

Using <a href=””></a> links to call JavaScript functions can be a bit trickier than you might think. The issues that I’ve run into are generally Internet Explorer-specific (aren’t they all?). While troubleshooting these issues, I’ve discovered a syntax that seems to solve all of the problems:

<a href=”javascript:void(0)” onclick=”yourFunction();return false”>Click Here</a>

Hopefully this helps someone.

{ 1 trackback }

Internet Explorer <a href=””></a> JavaScript Links | nateirwin.net
January 10, 2009 at 5:27 am

{ 3 comments… read them below or add one }

1 Harry M June 30, 2009 at 8:14 am

You helped immensely. Of course issue with IE in a video center trigger and it was adding the # and not just once but repeatedly appending it on tabs and in the title. You little help made it clear right up…thanks.

Reply

2 Rainer January 21, 2010 at 9:19 am

Worked perfectly.Thanks a lot!

Reply

3 Chris Bailey February 8, 2010 at 11:21 am

Can you explain how it works? and it did work for me too.

Reply

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: