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>
<desc>Selects all input, textarea, select and button elements.</desc>
<p>The <code>:input</code> selector basically selects all form controls.</p>
<note id="jquery-selector-extension" type="additional" data-selector=":input"/>
<desc>Finds all input elements.</desc>
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; });
textarea { height:25px; }
<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" />
<div id="messages">
<category slug="selectors/form-selectors"/>
<category slug="selectors/jquery-selector-extensions"/>
<category slug="version/1.0"/>
Jump to Line
Something went wrong with that request. Please try again.