Reputation: 735
Im using form_name.textbox.focus() and it working fine in IE but not in mozilla. Can someone tell me how to handle this? this for answering.
Upvotes: 1
Views: 971
Reputation: 272306
Give these a go:
document.form_name.textbox.focus()
document.form_name[ "textbox" ].focus()
Upvotes: 1
Reputation: 887887
You're using a non-standard IE behavior that turns all elements with IDs into global variables.
Since Firefox does not do this, form_name
is undefined
.
Change it to
document.getElementById("ID of <input> element").focus();
Upvotes: 4