Skip to content

peteboere/placeholder-shim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Another lightweight HTML5 placeholder shim for jQuery

  • 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.

Usage

HTML:

<input type="search" placeholder="Search site"/>

JS:

jQuery(function ($) {
    $('input, textarea').placeholderShim();
});

CSS:

.placeholder-shim {
    color: dodgerblue;
}

Compatibility

Tested in Internet Explorer 7, 8 and 9.

About

Another lightweight HTML5 placeholder shim for jQuery.

Resources

Stars

Watchers

Forks

Packages

No packages published