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.
Update the demo so it shows that <label> elements will now work prope…
…rly for password inputs in browsers that require an extra input field to fake the placeholder.
- Loading branch information
1 parent
4020aba
commit ece35eb
Showing
2 changed files
with
11 additions
and
4 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
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
textarea { height: 5em; width: 20em; } | ||
.placeholder { color: #aaa; } | ||
.note { border: 1px solid orange; padding: 1em; background: #ffffe0; } | ||
/* #p { background: lime; } */ | ||
</style> | ||
</head> | ||
<body> | ||
|
@@ -23,7 +24,7 @@ <h1>HTML5 Placeholder jQuery Plugin</h1> | |
<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. hunter2" id="p" class="x"></label></p> | ||
<p><label for="p"><code>type=password</code> </label><input type="password" name="password" placeholder="e.g. hunter2" id="p"></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> | ||
|
@@ -33,7 +34,7 @@ <h1>HTML5 Placeholder jQuery Plugin</h1> | |
<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. | ||
// Then uncomment the last rule in the <style> element (in the <head>). | ||
$(function() { | ||
// Invoke the plugin | ||
$('input, textarea').placeholder(); | ||
|