Home > Web Front-end > JS Tutorial > jquery tagname acquisition method_jquery

jquery tagname acquisition method_jquery

WBOY
Release: 2016-05-16 18:52:11
Original
986 people have browsed it

If you look up Jquery's API, you will find that this seems to be a blind spot of Jquery. There is no clear explanation on how to get the name of the HTML tag. If you use
$("H1") directly. tagName
cannot get a value like "H1" in this way, it seems that it will only get "undiffed".

Later I discovered that Jquery actually regards tagName as one of its attributes, which is interesting.
So use
$("H1").attr("tagName")



[Ctrl A select all Note:
If you need to introduce external Js, you need to refresh to execute ]
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template