Setting focus to a textbox when a function is called

前端 未结 2 1480
一整个雨季
一整个雨季 2020-12-18 19:59

I currently have a textbox in my aspx:

 

I was wondering if I could set the focus

2条回答
  •  天命终不由人
    2020-12-18 20:25

    Invoke the lowercase .focus() function:

    function setFocus() {
        document.getElementById("myTextbox").focus();
    }
    

提交回复
热议问题