更新时间:2023-12-05 14:57:16
谢邀~
这个getElementsByName
就是document特有的方法,
并不同与题主所说的其他方法
, 其他方法
适用于element
而且兼容性不好.
The getElementsByName method works differently in different browsers. In IE & Opera, getElementsByName() method will also return elements that have an id attribute with the specified value. so you should be careful not to use the same string as both a name and an ID.