Edit Article

This is for showing focus of a textbox element in a page with JavaScript.

Ad

EditSteps

  1. 1
    Create a textbox in a page.
    Ad
  2. 2
    Create a script tags.
  3. 3
    Use this code:
    • document.getElementById('idoftextbox').focus();
      • The codes must be in document ready function
  4. 4
    Be sure that it looks like this.
    • document.ready = function(){ document.getElementById('idoftextbox').focus(); }
    Ad

Article Info

Categories: JavaScript

Thanks to all authors for creating a page that has been read 578 times.

Did this article help you?
Yes No

Become
an Author!

Write an Article