Jquery Focus on input field

后端 未结 5 1398
误落风尘
误落风尘 2020-12-29 02:08

The HTML on the page has 20 fields each named and given ID\'s in increasing order from 1 to 20.

If the variable id is set to

5条回答
  •  清歌不尽
    2020-12-29 02:41

    replace

    $("#"+id).select();
    

    by

    $("#"+id).focus();
    

    or even by

    $(this).focus();
    

提交回复
热议问题