JQuery: Fuzzy matching HTML attributes

Source: Internet
Author: User

JQuery ("[Attribute |= value]")

Attribute Word header Selector (attribute contains prefix selector)

The code, such as jquery ("[Herflang |= ')"), will select all elements in the document that contain the Herflang attribute, and the value of Herflang begins with "en", even if "en" is followed by a hyphen "-".

JQuery ("[Attribute ^= value]")

Property start Selector (attribute starts with selector)

The element used to select the value of the attribute to start with a string, but the difference between jquery ("[Attribute] = value") is that if value is followed by a hyphen, the element is not selected. For example, jquery ("[Rel ^= ' no ']") will select all the rel values with the ' no ' element, but elements similar to rel= ' no-*** ' will not be selected.

JQuery ("[Attribute *= value]")

property contains selectors (attribute contains selector)

For example, jquery ("rel *= ' no ') means all elements with the Rel attribute and the value of rel containing the substring" no "(e.g. rel=" nofollow ", rel =" Yesorno ", etc.) will be selected.

JQuery ("attribute ~= value")

Property Word Selector (attribute contains word selector)

Value must be a separate word or string, such as jquery ("rel ~= No"), which, when executed, selects an element with rel= "Yes or no", but does not select an element with rel = "Yesorno". This selector can be seen as a supplement to a property containing a selector for when a strict match is required

JQuery ("[Attribute $= value]")

End-of-property selector (attribute ends with selector)

An element that selects the value of a particular property at the end of a string, such as jquery ("[Rel $= ' no ']") will select an element with the value of the Rel attribute ending with "no"

JQuery ("[attribute = value]")

Attribute parity selector (attribute equals selector)

Select only elements that have exactly the same value as the property, almost impossible.

JQuery ("Attribute! = value")

Attribute non-equal selector (attribute not equal selector)

Select an element that is not equal to a value, such as jquery ("[Rel! = nofollow]"), and all rel = "nofollow" elements are not selected

JQuery: Fuzzy matching HTML attributes

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.