62,267
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("#title").focus(function(){
if($(this).val()==$(this)[0].defaultValue)
$(this).css("color","#ccc");
})
$("#title").keydown(function(){
if($(this).val()==$(this)[0].defaultValue)
$(this).val("");
$(this).css("color","#333");
})
})
</script>
</head>
<body>
<input type="text" id="title" value="请输入标题" />
</body>
</html>