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.
Updated readme to show the plugin works with textareas as well. Clear…
… textarea values upon page reload
- Loading branch information
1 parent
933d050
commit 22b94f3
Showing
3 changed files
with
14 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 |
---|---|---|
|
@@ -10,21 +10,22 @@ This plugin was based on a code snippet by [Paul Irish](http://paulirish.com/), | |
|
||
### HTML | ||
|
||
<input type="text" name="foo" placeholder="Enter some text here"> | ||
<input type="email" name="bar" placeholder="Enter your email address"> | ||
<input type="search" name="baz" placeholder="Search this site…"> | ||
<input type="url" name="wtf" placeholder="Enter your URL"> | ||
<input type="tel" name="omg" placeholder="Enter your phone number"> | ||
<input type="text" name="name" placeholder="e.g. John Doe"> | ||
<input type="email" name="email" placeholder="e.g. [email protected]"> | ||
<input type="url" name="url" placeholder="e.g. http://mathiasbynens.be/"> | ||
<input type="tel" name="tel" placeholder="e.g. +32 472 77 69 88"> | ||
<input type="search" name="search" placeholder="Search this site…"> | ||
<textarea name="message" placeholder="Your message goes here"></textarea> | ||
|
||
### jQuery | ||
|
||
$('input').placeholder(); | ||
$('input, textarea').placeholder(); | ||
|
||
### CSS | ||
|
||
The plugin automatically adds `class="placeholder"` to the elements who are currently showing their placeholder text. You can use this to style placeholder text differently: | ||
|
||
input { color: #000; } | ||
input, textarea { color: #000; } | ||
.placeholder { color: #aaa; } | ||
|
||
## Notes | ||
|
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.