我需要在第一個字段中輸入 4 個字符后將焦點自動轉(zhuǎn)移到第二個字段。<input type="text" id="input1"><input type="text" id="input2">$("#input1").change(function() { if ($(this).val().length == 4) { $("#input2").focus(); }});但這不起作用。我缺少什么?我也嘗試過document.getElementById("input2").focus();但它也不起作用。
打字時自動改變焦點
素胚勾勒不出你
2023-07-14 14:57:30