html form required field javascript apply focus code example Example: set focus javascript document.getElementById("ThingToSetFocusOn").focus();