Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (47 sloc) 1.46 KB
<?xml version="1.0"?>
<entry type="selector" name="input" return="">
<title>:input Selector</title>
<sample>:input</sample>
<signature>
<added>1.0</added>
</signature>
<desc>Selects all input, textarea, select and button elements.</desc>
<longdesc>
<p>The <code>:input</code> selector basically selects all form controls.</p>
</longdesc>
<note id="jquery-selector-extension" type="additional" data-selector=":input"/>
<example>
<desc>Finds all input elements.</desc>
<code><![CDATA[
var allInputs = $(":input");
var formChildren = $("form > *");
$("#messages").text("Found " + allInputs.length + " inputs and the form has " +
formChildren.length + " children.");
// so it won't submit
$("form").submit(function () { return false; });
]]></code>
<css><![CDATA[
textarea { height:25px; }
]]></css>
<html><![CDATA[<form>
<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>
</form>
<div id="messages">
</div>]]></html>
</example>
<category slug="selectors/form-selectors"/>
<category slug="selectors/jquery-selector-extensions"/>
<category slug="version/1.0"/>
</entry>
Jump to Line
Something went wrong with that request. Please try again.