Jquery gets the tagName and makes a judgment

  • 2020-03-30 03:09:11
  • OfStack

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

Related articles: