HOW TO SET THE FOCUS IN AN ELEMENT USING JAVASCRIPT?

Awadhendra Tiwari

Total Post:510

Points:2550
Posted by  Awadhendra Tiwari
 1800  View(s)
Ratings:
Rate this:
  1. Awadhendra Tiwari

    Post:510

    Points:2550
    How to set the focus in an element using Javascript?

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!