- Does nothing if browser supports the placeholder attribute.
- Does not set the value of inputs; so no issues with browser autocomplete or accidentally posted forms.
- Uses ARIA for enhanced accessibility.
- Very small.
HTML:
<input type="search" placeholder="Search site"/>
JS:
jQuery(function ($) {
$('input, textarea').placeholderShim();
});
CSS:
.placeholder-shim {
color: dodgerblue;
}
Tested in Internet Explorer 7, 8 and 9.