Skip to content

Tiny polyfill for the placeholder form element attribute. Requires Prototype.js.

License

Notifications You must be signed in to change notification settings

EkoOne/placeholder-shiv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

placeholder-shiv

Tiny polyfill for the placeholder form element attribute. Requires Prototype.js.

This Prototype JavaScript simulates the placeholder attribute in browsers that do not support it yet. It doesn’t do anying if placeholders are supported, and degrades to show nothing if both placeholder and JavaScript support are missing.

To apply it, simply code your form elements with placeholders, and add a link to prototype.js and placeholder-shiv.js in the head of your page.

The only caution is that the placeholder text cannot be exactly the same as a potential input value. Pad the placeholder value with trailing spaces to avoid this issue.

About

Tiny polyfill for the placeholder form element attribute. Requires Prototype.js.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%