<A> tag issues in IE 9.0

Experts,

I have the folliwing <a> tag syntax and just upgraded to IE 9.0 and the code doesn't work.
It was and still working in IE 8.0

<a href="JavaScript:myFunction();"><img src="/images/my_button1.gif" border="0" width="50" height="20" alt="Submit"></a>

Any help is really appreciated

Thanks in advance
Tpaul_10Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
BanthorConnect With a Mentor Commented:
Original Post is invalid as href is not an attribute for script
<a href="JavaScript:myFunction();"><img src="/images/my_button1.gif" border="0" width="50" height="20" alt="Submit"></a>

Minimum change required but assumes that myFunction changes the _self.location
View will move to top of the construct.
<a href="#" onclick="JavaScript:myFunction();" defer="defer"><img src="/images/my_button1.gif" border="0" width="50" height="20" alt="Submit"></a>

if you don't need CSS info from the A tag. Then this would be the normal method and should work across all browsers.
<img src="/images/my_button1.gif" border="0" width="50" height="20" alt="Submit" onclick="myFunction()" defer="defer">

There are form image elements as well that might be more appropriate for your use.
0
 
BanthorCommented:
There is a new element in IE 9 A Tags to delay validation until the content has finished rendering.
defer="defer"
All other browsers will ignore this tag.
0
 
Tpaul_10Author Commented:
Thanks for the quick reply.
Do i need to add, defer="defer" in my "A" tag for IE 9.0 to work? Have tried, but didn't work.
How to fix the issue, appreciate your help
Thanks
0
All Courses

From novice to tech pro — start learning today.