Created
November 23, 2017 08:54
-
-
Save ilhantekir/97ca7e3a1eb36674b2ff857132aed421 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(“[attribute|=’value’]”) — The “attribute contains prefix selector” returns all elements with attributes whose value is equal to or starts with the given string followed by a hyphen. | |
$(“[attribute*=’value’]”) — This “attribute contains selector” returns all elements with attributes whose value contains the given substring. The location of the value doesn’t matter. As long as it matches with the given value the selector will select the element. | |
$(“[attribute~=’value’]”) — This selector returns all elements with attributes whose value contains a given word delimited by spaces. | |
$(“[attribute$=’value’]”) — This selector returns all elements with attributes whose value ends with the given string. | |
$(“[attribute=’value’]”) — This selector returns all elements with attributes whose value is exactly equal to a given string. | |
(“[attribute^=’value’]”) — This selector will return all elements with attributes whose value begins exactly with a given string. | |
(“[attribute!=’value’]”) — This selector returns all elements that either don’t have a given attribute or the value of the attribute is not equal to the one specified in the selector. | |
:contains(text) — This selector returns all elements which have the specified text. The text can appear either directly inside the element or inside one of its descendants. While selecting elements using this selector, keep in mind that the text is case sensitive. | |
:has(selector) — This one returns all elements which have at least one element inside them that matches the specified selector. For instance, $("section:has(h2)") will select all sections that have an h2 element. The h2 does not need to be a direct child. It can exist anywhere among the descendants. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment