Jquery gets the tagName and makes a judgment


If the purpose is to get the tagName and then judge, it is more convenient to directly use the following code:

$(element) is () ‘input’

If you want to get the tag to use elsewhere, you can use the following code:

$(element) [0]. TagName Or: $(element). The get (0). TagName