If you want to get the tagName and then judge, 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 following code:
$(element)[0].tagName
or:
$(element).get(0).tagName