My good friend, ex-colleague and all round awesome dude Dan Bentley has made a great little jQuery placeholder plugin which polyfills older browsers that don’t support the new HTML5 form attribute placeholder.
Link: https://github.com/danbentley/placeholder
Now I’ll readily admit that Dan has done 99% of the work here, but it has been something of a joint project in that:
- I actually made him build it cos he’s amazing at JS and I needed it.
- I’ve added a tiny, tiny bit of CSS/UI behaviour.
There’s my 1%.
Anyway, follow the project on GitHub, follow Dan on Twitter and GitHub and let us know if you use it!
By Harry Roberts on Tuesday, May 24th, 2011 in Web Development. Tags: CSS, Forms, JavaScript, jQuery, UI | 2 Comments »
+
Matt Hinchliffe said on 24 May, 2011 at 9:23 pm
Very tiny, neat implementation. Good stuff. If being used in place of a label I like to place the label text into the input then hide the label. For a pure JS implementation see my little project too =)
https://github.com/i-like-robots/Placeholder-Labels
Khalid said on 25 May, 2011 at 4:02 pm
I switched to html5, but I was still using the old javascript method (onfocus, onblur et cetera) for IE7 and 8. I changed my forms with this plugin in a few minutes. Thanks (Dan).