diff --git a/README.md b/README.md index 5cad572..6a6a30a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # HTML5 Placeholder jQuery Plugin -This plugin was based on a code snippet by [Paul Irish](http://paulirish.com/), featured in [jQuery 1.4 Hawtness #1](http://jquery14.com/day-05/jquery-1-4-hawtness-1-with-paul-irish). I added some functionality, did some optimizations here and there, and made a plugin out of it. - ## Demo & Examples [http://mathiasbynens.be/demo/placeholder](http://mathiasbynens.be/demo/placeholder) @@ -32,10 +30,10 @@ The plugin automatically adds `class="placeholder"` to the elements who are curr ## Notes * Works in all A-grade browsers, including IE6. -* The plugin automatically checks if the browser supports the HTML5 placeholder attribute for inputs natively. If this is the case, the plugin won’t do anything. +* The plugin automatically checks if the browser natively supports the HTML5 `placeholder` attribute for `input` and `textarea` elements. If this is the case, the plugin won’t do anything. If `@placeholder` is only supported for `input` elements, the plugin will only apply to `textarea`s. (This is the case for Safari 4.) ## Credits -Kudos to [Paul Irish](http://paulirish.com/) for his snippet and everyone from [#jquery](http://webchat.freenode.net/?channels=jquery) for the tips and ideas. +Kudos to [Paul Irish](http://paulirish.com/) for his inspiring snippet in [jQuery 1.4 Hawtness #1](http://jquery14.com/day-05/jquery-1-4-hawtness-1-with-paul-irish) and everyone from [#jquery](http://webchat.freenode.net/?channels=jquery) for the tips, ideas and patches. _– [Mathias](http://mathiasbynens.be/)_ \ No newline at end of file diff --git a/demo.html b/demo.html index a774553..c6f4fb7 100644 --- a/demo.html +++ b/demo.html @@ -36,9 +36,17 @@
Your current browser supports placeholder
natively. The plugin won’t run in this case, since it’s not needed. If you want to test the plugin, use an older browser ;)
placeholder
for input
and textarea
elements. The plugin won’t run in this case, since it’s not needed. If you want to test the plugin, use an older browser ;)';
+ } else if (isInputSupported) {
+ html = 'Your current browser natively supports placeholder
for input
elements, but not for textarea
elements. The plugin will only do its thang on the textarea
s.';
+ }
+ if (html) {
+ $('' + html + '
').insertAfter('form'); + } });