$.fn.placeholder = function(){
  // quit if there's support  for html5 placeholder  
  //  if (this[0] && 'placeholder' in document.createElement('input')) return;
  return this.each(function() {
    $(this).focus(function() {
      var val = $.trim($(this).val());
      if (val === $(this).attr('placeholder')) {
        $(this).val('');
      }

    }).blur(function(){
      var val = $.trim($(this).val());
      if (val === ''){
        $(this).val( $(this).attr('placeholder') );
      }  
    });
    if ($(this).attr('placeholder') && $.trim($(this).val()) == '') {
      $(this).val($(this).attr('placeholder'));
    }
  })
}
$(document).ready(function() {
	$('[placeholder]').placeholder();
})