Home > Web Front-end > JS Tutorial > body text

jquery gets tag name (tagName) sample code_jquery

WBOY
Release: 2016-05-16 17:29:05
Original
1241 people have browsed it

If you want to get the tagName and then judge, it will be more convenient to use the following code directly:

Copy the code The code is as follows:

$(element).is('input')

If you want to get the tag and use it elsewhere, you can use the following code:
Copy code The code is as follows:

$(element)[0].tagName
or:
$(element).get(0).tagName
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