mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-17 22:40:31 +00:00
72 lines
No EOL
2.3 KiB
HTML
72 lines
No EOL
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang='en'><head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1"><meta http-equiv='content-type' content='text/html; charset=UTF-8' /></head><body>
|
|
<div data-role="page">
|
|
<div data-role="header">
|
|
<h1>:input Selector</h1>
|
|
|
|
</div>
|
|
<div data-role="content" data-theme="c" id="input1">
|
|
<h2 class="jq-clearfix roundTop section-title">
|
|
<span class="name">input</span> selector</h2>
|
|
<div class=" entry-details">
|
|
<h4 class="name">
|
|
<span class="versionAdded">version added: <a href="/version/1.0/">1.0</a></span>jQuery(':input')</h4>
|
|
<p class="desc"><strong>Description: </strong>Selects all input, textarea, select and button elements.</p>
|
|
<div class="longdesc"><p>The <code>:input</code> selector basically selects all form controls.</p></div>
|
|
<h3>Example:</h3>
|
|
<div id="entry-examples" class="entry-examples"><div id="example-0">
|
|
<h4><span class="desc">Finds all input elements.</span></h4>
|
|
<pre><code class="example demo-code"><!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
textarea { height:25px; }
|
|
</style>
|
|
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
|
</head>
|
|
<body>
|
|
<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>
|
|
<script>
|
|
|
|
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; });
|
|
|
|
</script>
|
|
</body>
|
|
</html></code></pre>
|
|
<h4>Demo:</h4>
|
|
<div class="demo code-demo"></div>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body></html> |