function focus(element) {
document.form.element.focus();
}
I want to have a function to focus on an input box, but it seems I can’t do that. Is there a better way to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re passing
elementdirectly to the function, callfocusdirectly on that.If you’re just passing the name of the element to the function, then ..