Home >Web Front-end >HTML Tutorial >通过class获取id值_html/css_WEB-ITnose

通过class获取id值_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 08:56:171345browse


如何通过class取到id的“aaa”?
求高手解答


回复讨论(解决方案)

$('.name')[0].id

var arr = getElementsByClassName('name')
for (var i = 0, len = arr.length; i 

一楼正解。。

一楼正解。。

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