-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathattribute-contains-selector.xml
More file actions
23 lines (22 loc) · 1.25 KB
/
attribute-contains-selector.xml
File metadata and controls
23 lines (22 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<entry type='selector' name="attributeContains" 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 containing the a given substring.</desc>
<longdesc><p>This is the most generous of the jQuery attribute selectors that match against a value. It will select an element if the selector's string appears anywhere within the element's attribute value. Compare this selector with the Attribute Contains Word selector (e.g. [attr~="word"]), which is more appropriate in many cases.</p></longdesc>
<example>
<desc>Finds all inputs with a name attribute that contains 'man' and sets the value with some text.</desc>
<code><![CDATA[$('input[name*="man"]').val('has man in it!');]]></code>
<html><![CDATA[<input name="man-news" />
<input name="milkman" />
<input name="letterman2" />
<input name="newmilk" />]]></html>
</example>
<category slug="selectors/attribute-selectors"/>
<category slug="version/1.0"/>
</entry>