Focus Input Box On Load

后端 未结 11 2582
无人及你
无人及你 2020-11-30 01:10

How can the cursor be focus on a specific input box on page load?

Is it posible to retain initial text value as well and place cursor at end of input?



        
11条回答
  •  难免孤独
    2020-11-30 01:37

    Add this to the top of your js

    var input = $('#myinputbox');
    
    input.focus();
    

    Or to html

    
    

提交回复
热议问题