How to force autofocus on a Textbox with javascript if autofocus does not work ( autofocus is not working)

Question:  autofocus is not working on a textbox, I tried $('#textboxName').focus(); and it does not work.

Login to See the Rest of the Answer

If autofocus is working on your textbox, use setTimerout function to trigger autofocus on a textbox. See the code below:


setTimeout(function () {

If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

© 2023 - ErnesTech LLC- Privacy