Home > Article > Web Front-end > jquery uses $(element).is() to determine the obtained tagName_jquery
If you want to get the tagName and then make a judgment, you can use jquery $(element).is() to achieve it.
If you want to get the tagName and then make a judgment, it will be more convenient to use the following code directly:
$(element).is('input')
If you want to get the tag and use it elsewhere, you can use the code:
$(element)[0].tagName 或: $(element).get(0).tagName