forked from mathiasbynens/jquery-placeholder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid duplicate IDs for password inputs. Fixes mathiasbynens#9.
- Loading branch information
1 parent
9d25f91
commit 4020aba
Showing
3 changed files
with
16 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,20 +17,23 @@ | |
<h1>HTML5 Placeholder jQuery Plugin</h1> | ||
<p>Check out <a href="http://github.com/mathiasbynens/Placeholder-jQuery-Plugin">the HTML5 Placeholder jQuery Plugin project page on GitHub</a>.</p> | ||
<pre><code>$(function() {<br> $('input, textarea').placeholder();<br>});</code></pre> | ||
<form action="placeholder" method="get"> | ||
<form> | ||
<p><label><code>type=search</code> <input type="search" name="search" placeholder="Search this site…"></label></p> | ||
<p><label><code>type=text</code> <input type="text" name="name" placeholder="e.g. John Doe"></label></p> | ||
<p><label><code>type=email</code> <input type="email" name="email" placeholder="e.g. [email protected]"></label></p> | ||
<p><label><code>type=url</code> <input type="url" name="url" placeholder="e.g. http://mathiasbynens.be/"></label></p> | ||
<p><label><code>type=tel</code> <input type="tel" name="tel" placeholder="e.g. +32 472 77 69 88"></label></p> | ||
<p><label><code>type=password</code> <input type="password" name="password" placeholder="e.g. h4x0rpr00fz"></label></p> | ||
<p><label><code>type=password</code> <input type="password" name="password" placeholder="e.g. hunter2" id="p" class="x"></label></p> | ||
<p><label><code>textarea</code> <textarea name="message" placeholder="Your message goes here"></textarea></label></p> | ||
<p><input type="submit" value="type=submit"></p> | ||
</form> | ||
<p>— <a href="http://mathiasbynens.be/" title="Mathias Bynens, front-end developer">Mathias</a></p> | ||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | ||
<script src="jquery.placeholder.js"></script> | ||
<script> | ||
// To test the @id toggling on password inputs in browsers that don’t support changing an input’s @type dynamically (e.g. Firefox 3.6 or IE), uncomment this: | ||
// jQuery.fn.hide = function() { return this; } | ||
// Then add an @id to the password input and apply some styles to it. | ||
$(function() { | ||
// Invoke the plugin | ||
$('input, textarea').placeholder(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.