jq input输入框失焦、聚焦

input自动填写完成顺序聚焦
html

        <input type="text" id='name' name="one" maxlength="1"  oninput="burd(this.id)">
        <input type="text" id='name1' name="two" maxlength="1" oninput="burd(this.id)">
        <input type="text" id='name11' name="three" maxlength="1" oninput="burd(this.id)">
        <input type="text" id='name111' name="fore" maxlength="1" oninput="burd(this.id)">
        <input type="text" id='name1111' name="five" maxlength="1" oninput="burd(this.id)">

js

  function burd(id){
        if($('#'+id).val().length==1){
          $('#'+id).blur()
          $('#'+id+"1").focus()
        }
  }

猜你喜欢

转载自blog.csdn.net/weixin_43812068/article/details/85780405
jq