DEVFYI - Developer Resource - FYI

How to set the focus in an element using Javascript?

JavaScript Interview Questions and Answers


(Continued from previous question...)

42. How to set the focus in an element using Javascript?

<script> function setFocus() { if(focusElement != null) { document.forms[0].elements["myelementname"].focus(); } } </script>

(Continued on next question...)

Other Interview Questions