cross browser placeholder.
Include the script and add a class "placeholder" to any form control you wish to add the functionality
create a placeholder for the element
<input type="text" class="placeholder" value="Name"/> <input type="password" class="placeholder" value="Password"/> <textarea class="placeholder">Your message...</textarea>
you can also add the functionality manually by calling the method autoempty on an element like this. you can pass the text to use as placeholder to autoempty, if you do not specify a text, the default value is used.
var control = $(form.control); //the default value will be used as the placeholder with a custom color control.autoempty({color: '#0E8F94'}); //change the placeholder text to 'Please type your name' control.autoempty('Please type your name');
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus