Подписи полей форм в value самих полей

Aug 08, 2011 14:36

jQuery( function ($) {
  $('form textarea').each( function () {
    this.defaultValue = this.value;
  } );

$('form input, form textarea').focus( function () {
    this.value = this.value == this.defaultValue ? '' : this.value;
  } ).blur( function () {
    this.value = this.value || this.defaultValue;
  } );
});

caption, field, default, form, jquery

Previous post Next post
Up