Jquery uses $ (element). is () to determine the obtained tagName, jquery. is

Source: Internet
Author: User

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]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.