468,301 Members | 1,555 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,301 developers. It's quick & easy.

images(name|index).focus in Firefox

Is there a way to give an image focus in Firefox? This works in IE and
Opera:

if (document.images('foo').focus) {
document.images('foo').focus();
}

Thanks
Timo
Jul 23 '05 #1
2 1523


Timo wrote:
Is there a way to give an image focus in Firefox?
An image can't receive input so why do you want to give it focus?
This works in IE and
Opera:

if (document.images('foo').focus) {
document.images('foo').focus();
}


Make that ['foo'] in those two lines instead of ('foo') if you want to
prevent errors in many browsers.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Trying to make sure than none of the textboxes has focus. Why? You really
don't want to know. :-)
Timo
Thanks for the syntax tip about [ ] vs ( ).

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:42***********************@newsread2.arcor-online.net...

An image can't receive input so why do you want to give it focus?

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Chris | last post: by
3 posts views Thread by Ricardo Sanchez | last post: by
61 posts views Thread by phil-news-nospam | last post: by
3 posts views Thread by littleark | last post: by
10 posts views Thread by eholz1 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.