document.all.item()是通过元素的name和id来得到名字
<input type="button" name="button1">
document.all.item(“button01”) 可以得到该button按钮
document.all.button1和document.all.item(“button01”) 的作用一样
区别是如果元素的name值是数字的话,如
那么document.all.123会报错,而document.all.item(“123”)就可以了
本文详细介绍了document.all.item()方法的使用技巧,对比了它与document.all属性的区别,尤其是在处理数字作为元素名称的情况。当元素的name值为数字时,使用document.all.item()可以避免语法错误。


被折叠的 条评论
为什么被折叠?



