Please see this fiddle: http://jsfiddle.net/yg49k/
The following code works fine in FireFox but doesn't work in the latest version of Chrome.
HTML:
<input type="text" id="one" placeholder="Type two chars" />
<input type="text" id="two" placeholder="It should focus here" />
jQuery:
$("#one").on("input", function() {
if($("#one").val().length == 2) { $("#two").focus(); }
});
Does anyone know how I can get around this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…