/ Published in: jQuery
Expand |
Embed | Plain Text
(function($) { $.fn.mask = function() { return $(this).each(function() { var $this = $(this), text = $this.val(); //when focused ont the input $this.focus(function(){ if($this.val() == text) $this.val(""); }); //looses focus $this.blur(function() { if($this.val() == "") $this.val(text); }); }); } })(jQuery); $(document).ready(function() { $('#input').mask(); });
You need to login to post a comment.
