var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opens = _____WB$wombat$assign$function_____("opens"); How to Focus Text Box in a Page with JavaScript: 4 Steps
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

}