Answers for "js focus text input"

2

set focus on input field javascript

window.onload=function(){
 document.getElementById("id_here").focus();
}
// id_here = put the id of the HTML element where you want to set focus.
Posted by: Guest on April-23-2021
3

javascript select input text on focus

focusMethod = function getFocus() {           
  document.getElementById("myTextField").focus(); //select the input textfield and set the focus on it
}
Posted by: Guest on November-28-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language