- $("#s")
- .val("Search...")
- .CSS("color", "#ccc")
- .focus(function(){
- $(this).css("color", "black");
- if ($(this).val() == "Search...") {
- $(this).val("");
- }
- })
- .blur(function(){
- $(this).css("color", "#ccc");
- if ($(this).val() == "") {
- $(this).val("Search...");
- }
- });
- //该片段来自于http://www.codesnippet.cn/detail/081120137005.html
来源: http://www.codesnippet.cn/detail/081120137005.html