Skip to content

Instantly share code, notes, and snippets.

View mrcgrtz's full-sized avatar
🐌
I may be slow to respond.

Marc Görtz mrcgrtz

🐌
I may be slow to respond.
View GitHub Profile
@mrcgrtz
mrcgrtz / placeholder.js
Created April 21, 2010 10:29
Adds something like HTML5 placeholders when they are not supported by your browser. Usage: <input placeholder="Foobar">
var MyApp = {
addPlaceholders: function(props) {
// default configuration
var config = {
'class': 'placeholder' // apply CSS classes to an input displaying a placeholder
};
// if any properties were supplied, apply them to the config object