2012-03-03 90 views
-2

如何更改jquery提示文本颜色。目前它与textfield的颜色相同,但我希望它有所不同!如何更改jquery提示颜色

$(document).ready(function() { 
    //Shows the title in the text box, and removes it when modifying it 
    $('input[title]').each(function (i) { 
     $(this).val($(this).attr('title')).addClass('hint'); 

     $(this).focus(function() { 
      if ($(this).val() == $(this).attr('title')) { 
       $(this).val('').removeClass('hint'); 
      } 
     }); 

     $(this).blur(function() { 
      if ($(this).val() == '') { 
       $(this).val($(this).attr('title')).addClass('hint'); 
      } 
     }); 
    }); 

    //Clear input hints on form submit 
    $('form').submit(function() { 
     $('input.hint').val(''); 
     return true; 
    }); 
}); 
+0

如果你正在寻找的样式标题属性,你不能。 – j08691 2012-03-04 00:10:38

回答