<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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
BanthorCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.