Question:  autofocus is not working on a textbox, I tried $('#textboxName').focus(); and it does not work. Answer: If autofocus is working on your textbox, use setTimerout function to trigger autofocus on a textbox. See the code below: $(document).ready(function(){ setTimeout(function () { $('#IdOfTextBox').focus(); }); });