images(name|index).focus in Firefox

T

Timo

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
 
M

Martin Honnen

Timo said:
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.
 
T

Timo

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 ( ).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top