forked from jquery/api.jquery.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbutton-selector.xml
54 lines (49 loc) · 1.59 KB
/
button-selector.xml
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0"?>
<entry type="selector" name="button" return="">
<title>:button Selector</title>
<sample>:button</sample>
<signature>
<added>1.0</added>
</signature>
<desc>Selects all button elements and elements of type button.</desc>
<longdesc>
<p>An equivalent selector to <code>$(":button")</code> using valid CSS is <code>$("button, input[type='button']")</code>.</p>
</longdesc>
<note id="jquery-selector-extension" type="additional" data-selector=":button"/>
<example>
<desc>Find all button inputs and mark them.</desc>
<code><![CDATA[
var input = $(":button").addClass("marked");
$("div").text( "For this type jQuery found " + input.length + "." );
$("form").submit(function () { return false; }); // so it won't submit
]]></code>
<css><![CDATA[
textarea { height:35px; }
div { color: red; }
fieldset { margin: 0; padding: 0; border-width: 0; }
.marked { background-color: yellow; border: 3px red solid; }
]]></css>
<html><![CDATA[<form>
<fieldset>
<input type="button" value="Input Button"/>
<input type="checkbox" />
<input type="file" />
<input type="hidden" />
<input type="image" />
<input type="password" />
<input type="radio" />
<input type="reset" />
<input type="submit" />
<input type="text" />
<select><option>Option<option/></select>
<textarea></textarea>
<button>Button</button>
</fieldset>
</form>
<div>
</div>]]></html>
</example>
<category slug="selectors/form-selectors"/>
<category slug="selectors/jquery-selector-extensions"/>
<category slug="version/1.0"/>
</entry>