Home >Web Front-end >JS Tutorial >jQuery research experience: Get the value of the attribute_jquery

jQuery research experience: Get the value of the attribute_jquery

WBOY
WBOYOriginal
2016-05-16 19:07:49960browse

How to get the value of an attribute?
Html:

sss

Get the value of attribute custom attribute Bruce:
alert($("div[@Bruce]").attr("Bruce"));
Get the content of the Div whose attribute Bruce is Yes:
alert($("div[@Bruce]").html());
alert($("div[@Bruce=Yes]"). html());
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