The reason you're seeing that error is because document.getElementsByName
returns a NodeList
of elements.(您看到该错误的原因是因为document.getElementsByName
返回元素的NodeList
。)
And a NodeList
of elements does not have a .value
property.(并且元素的NodeList
没有.value
属性。)
Use this instead:(使用此代替:)
document.getElementsByName("acc")[0].value
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…