Jquery uses $ (element). is () to determine the obtained tagName, jquery. is
If you want to get the tagName before making a judgment, you can use jquery $ (element). is.
If you want to get the tagName before making a judgment, it is more convenient to use the following code:
$ (Element). is ('input ')
If you want to use tags for other purposes, you can use the code:
$ (Element) [0]. tagName or: $ (element). get (0). tagName
Jquery checks whether the element type is div or other
The usage is correct. That's how it is used. Maybe you have set something wrong, for example, div is not closed, and jquery version is too low. Otherwise, it must be true.
Question about createElement (tagName) in js
Hello, createElement is a method under document in DOM. It creates a document node, but this node is not inserted into the document stream, only in the memory of the browser process.
For more information about the attributes and methods of the document Object, refer to: document
Yang yunjun [authoritative expert]