您的位置:首页 > 其它

鼠标点击文本框后,里面的文字就消失,鼠标离开文本框后,里面的文字又会显示

2012-02-02 20:31 405 查看

<!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" content="text/html; charset=utf-8" />

<title>鼠标点击文本框后,里面的文字就消失,鼠标离开文本框后,里面的文字又会显示</title>

</head>

<body>

<input name="key" type="text" id="key" value="关键词" size="30"

onmouseover=this.focus();this.select();

onclick="if(value==defaultValue){value='';this.style.color='#000'}"

onBlur="if(!value){value=defaultValue;this.style.color='#999'}" style="color:#999" />

</body>

</html>

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐