HOW TO SET THE FOCUS IN AN ELEMENT USING JAVASCRIPT?

Amit Singh

Total Post:565

Points:2825
Posted by  Amit Singh
 1362  View(s)
Ratings:
Rate this:
  1. Amit Singh

    Post:565

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

    Setting 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!