|
-
Jun 26th, 2002, 08:40 AM
#1
Thread Starter
Addicted Member
Putting focus on image
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?
-
Jun 26th, 2002, 09:10 AM
#2
Thread Starter
Addicted Member
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
-
Jun 26th, 2002, 10:52 AM
#3
Fanatic Member
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.
Code:
<a href="#" onclick="aJavascriptFunction()">This is a link</a>
This is same for the <img> tag too...
Code:
<img src="image1.jpg" onclick="aJavascriptFunction()" />
Take a look at this information http://www.devguru.com/Technologies/...tml_index.html
-
Jun 28th, 2002, 07:57 AM
#4
Hyperactive Member
you are correct when you say that "href doesnt take javascript"
I see that a lot but don't understand when href cannot take javascript. what about href="javascript:functionName()"
regards
bsw2112
-
Jun 28th, 2002, 09:11 AM
#5
Fanatic Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|