-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathattribute-contains-prefix-selector.xml
More file actions
32 lines (28 loc) · 1.22 KB
/
attribute-contains-prefix-selector.xml
File metadata and controls
32 lines (28 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<entry type='selector' name="attributeContainsPrefix" return="" >
<sample>[attribute|="value"]</sample>
<signature><added>1.0</added>
<argument name="attribute" type="String">
<desc>An attribute name.</desc>
</argument>
<argument name="value" type="String">
<desc>An attribute value. Can be either an unquoted single word or a quoted string.</desc>
</argument> </signature>
<desc>Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-).</desc>
<longdesc><p>This selector was introduced into the CSS specification to handle language attributes.</p></longdesc>
<example>
<desc>Finds all links with an hreflang attribute that is english.</desc>
<code><![CDATA[
$('a[hreflang|="en"]').css('border','3px dotted green');
]]></code>
<html><![CDATA[
<a href="example.html" hreflang="en">Some text</a>
<a href="example.html" hreflang="en-UK">Some other text</a>
<a href="example.html" hreflang="english">will not be outlined</a>
]]></html>
<css><![CDATA[
a { display: inline-block; }
]]></css>
</example>
<category name="Attribute" slug="attribute-selectors"/>
<category name="Version 1.0" slug="1.0"/>
</entry>