jQuery [attribute | = value] Selector
Examples
Select all properties with title to "Tomorrow" at the beginning of the <p> element:
$("p[title|='Tomorrow']")
try it"
Definition and Usage
[Attribute | = value] selector to select each element with the specified attribute value of the element is equal to the specified string (such as "en") or to the connector as a string followed by the beginning of the string (such as "en- us ").
Tip: This selection is often used to process language properties.
grammar
$("[attribute|='value']")
参数 | 描述 |
---|---|
attribute | 必需。规定要查找的属性。 |
value | 必需。规定属性值需以此开头的字符串。 |
More examples
Processing language attribute
This example selects all elements with hreflang <a> property to the value "en" at the beginning of.