Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function ($) {
- $.fn.watermark = function (text) {
- return this.each(function () {
- $(this).attr('rel', text);
- if($(this).val() == '') $(this).val(text).addClass('watermark');
- $(this).focus(function () {
- if ($(this).val() == $(this).attr('rel')) {
- $(this).removeClass('watermark');
- $(this).val('');
- }
- });
- $(this).blur(function () {
- if ($(this).val() == '') {
- $(this).addClass('watermark');
- $(this).val($(this).attr('rel'));
- }
- });
- });
- };
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement