Skip to content

Simple jQuery plugin to support HTML5 placeholder attribute in all browsers.

License

Notifications You must be signed in to change notification settings

blacksrc/jQuery-Placeholder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jQuery Placeholder

Simple jQuery plugin to support HTML5 placeholder attribute.

How To Do:

First download jquery.placeholder.js and jquery.js then include the files to your page.

  <script src="jquery.js"></script>;
  <script src="jquery.placeholder.js"></script>;

Then use it like this:

  $("input[type='text']").placeholder(); // Select all text inputs
  $("input, textarea").placeholder(); // Select all inputs and textarea

If the browser supports HTML5 placeholder attribute, then the plugin doesn't do anything. But, if the browser does not support it. The plugin will do its job.

If you want to force any old or new browser to use the plugin placeholder no matter the browser support it or not you can set force option as true. Just like this:

  $("input[type='text']").placeholder({ force: true }); // Select all text inputs and force all browsers
  $("input, textarea").placeholder({ force: true }); // Select all inputs and textarea and force all browsers

By defult force is false.

About

Simple jQuery plugin to support HTML5 placeholder attribute in all browsers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published