Why can't I do this in a function?

Posted by Doug on Stack Overflow See other posts from Stack Overflow or by Doug
Published on 2010-04-11T21:49:36Z Indexed on 2010/04/11 21:53 UTC
Read the original article Hit count: 302

Filed under:
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?

© Stack Overflow or respective owner

Related posts about JavaScript