[英]Uncaught SyntaxError: Unexpected number
我在這里有這個代碼:
var first = orfirst;
second = eval("document.love.name" +ea).value.toUpperCase();
var names=second;
second = second.replace(r,"");
使用此代碼:
("document.love.name" +ea).value.toUpperCase();
我收到一個錯誤:未捕獲TypeError:無法讀取未定義的屬性'name1'
其中: <input value='' name=name1 onkeyup=checnum(this) type=text size=15>
因為他們說這個代碼id已棄用: document.love.name
我試着這樣做: second = eval("document.getElementById('name')" +ea).value.toUpperCase();
。
然后我收到此錯誤:Uncaught SyntaxError:意外的數字
誰能告訴我或更正代碼? 提前致謝。
如何為元素添加ID並使用以下代碼:
document.getElementById("name"+ea).value.toUpperCase();
感謝@Quentin和@Prisoner發現目前沒有身份證。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.