Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function($){
- $.fn.defaultValue = function(){
- return this.each(function(){
- var default_value = $(this).val();
- var $this = $(this);
- $this.focus( function() {
- if ($this.val() == default_value) $(this).val("");
- });
- $this.blur( function() {
- if ($this.val().length == 0){
- $this.val(default_value);
- }
- })
- });
- };
- $('input[type=text], textarea, input[type=email], input[type=tel], input[type=number], input[type=password]').defaultValue();
- });
Advertisement
Add Comment
Please, Sign In to add comment