仿照填写序列号

模仿填写序列号function autoFocus(objId){var id macAddr+(objId+1)var next document.getElement

模仿填写序列号

 function autoFocus(objId){        var id = "macAddr"+(objId+1);        var next = document.getElementById(id);        if(document.getElementById("macAddr"+objId).value.length==2 && next!=undefined){            next.focus();        }    }   $(document).ready(function(){        $(":input[id^='macAddr']").bind('keyup', handleAddr);   });   function handleAddr(){           var current = this;           var currvalue = current.value;           var reg = /[^\A-Fa-f0-9]|_/ig;           if(reg.test(currvalue)){               alert('invalid');           }           else{             var index = parseInt(current.id.substring(7)) ;             autoFocus(index);           }    }