<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charsetGB2312" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>浣挎枃鏈鐐瑰嚮鏃舵枃瀛楁秷澶辮剼鏈?lt;/title>
</head>
<body>
<input type="text" value="璇瘋緭鍏ユ?zhèn)ㄧ殑濮撳? id="myinput" size="60" />
</body>
</html>
<script language="JavaScript" type="text/javascript">
function addListener(element,e,fn){
if(element.addEventListener){
element.addEventListener(e,fn,false);
} else {
element.attachEvent("on" + e,fn);
}
}
var myinput = document.getElementById("myinput");
addListener(myinput,"click",function(){
myinput.value = "";
})
addListener(myinput,"blur",function(){
myinput.value = "璇瘋緭鍏ユ?zhèn)ㄧ殑濮撳?;
})
</script>
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" c />
<title>鐐瑰嚮鏂囨湰妗嗭紝鎻愮ず璇存槑瀛楁秷澶憋紒</title>
<script type="text/javascript" src="http://www.veryhuo.com/uploads/common/js/jquery-1.4.2.min.js"></script>
</head>
<body>
<script>
$(document).ready(function(){
$("TEXTAREA,input[focucmsg]") .each (function(){
$(this).val($(this).attr("focucmsg"));
$(this).val($(this).attr("focucmsg")).css("color","#979393");
$(this).focus(function(){
if($(this).val() == $(this).attr("focucmsg"))
{
$(this).val('');
$(this).val('').css("color","#6b6969");
}
});
$(this).blur(function(){
if(!$(this).val()){
$(this).val($(this).attr("focucmsg"));
$(this).val($(this).attr("focucmsg")).css("color","#979393");
}
});
});
});
</script>
<input name="" type="text" focucmsg="璇瘋緭鍏ュ叧閿瓧...錛? />
<textarea style="width:150px; height:50px;" name="" cols="" rows="" focucmsg="鎶婅嚜宸辯殑蹇冩儏鍐欎笂鏉ュ惂錛?> </textarea>
</body>
</html>