Home  >  Article  >  Backend Development  >  求解答

求解答

WBOY
WBOYOriginal
2016-06-23 14:22:20825browse



一样的事件 一样的id为什么里面的判断只有前面个能用 后面个用不了


回复讨论(解决方案)

不要贴图片,贴文本代码,不知道你说哪个id用不了。

在一个页面中 id 必须是唯一的!

从获取 id 的函数名中也可以看出这一点
获取指定的id:getElementById
获取指定的name:getElement sByName

没有复数 s 就表示只取一个

id是不能重复的,亲。

JS的方式ByID只能获取一个。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn