JS代碼: function open_user(){ var ID_length = document.getElementById("idinput").value; if (ID_length.length > 3) { window.open("用戶登錄界面.html"); }else{ alert("wrong"); }html部分代碼:<a href="" id="land" style="display: inline-block;width: 272px;height: 42px;background: #dcbd40;text-align: center;line-height: 42px;color: black;text-decoration: none;font-size: 17px;" onclick="open_user()">登錄</a>如圖,無論輸入內容的長度是否滿足條件都會彈出錯誤,求大佬幫助。
用javascript判斷獲取內容長度的問題
桃花長相依
2019-02-25 14:35:31