Hi all,
Is there a way of
When you tab along of putting the focus on a <IMG tag that contains an image other than using the <A or <button tag?
Printable View
Hi all,
Is there a way of
When you tab along of putting the focus on a <IMG tag that contains an image other than using the <A or <button tag?
Or can i put something in the HREF=???? So that there will be no link . I will only use the event OnKeypress,OnMouseUp Etc....
Because when you press on the image i am calling a Javascript function and the HREF doesnt take JavaScript
Thanks
you are correct when you say that "href doesnt take javascript" but thats not the only way get javascript to occur upon clicking the mouse on an anchor tag.
The anchor tag supports html 4.01 core attributes so you can use onclick... eg.
This is same for the <img> tag too...Code:<a href="#" onclick="aJavascriptFunction()">This is a link</a>
Take a look at this information http://www.devguru.com/Technologies/...tml_index.htmlCode:<img src="image1.jpg" onclick="aJavascriptFunction()" />
I see that a lot but don't understand when href cannot take javascript. what about href="javascript:functionName()"Quote:
you are correct when you say that "href doesnt take javascript"
regards
bsw2112
href= attrubte:
The href attribute will only run javascript code if explicity told to do so ie: href="javascript:functionName();" If you attempt to run a function without telling the browser it's javascript it will think you are attempting to located another html page.
-Matt