读书人

鼠标点符号击文本框后里面的文字就消

发布时间: 2012-10-08 19:54:56 作者: rapoo

鼠标点击文本框后,里面的文字就消失,鼠标离开文本框后,里面的文字又会显示
今天么事干浏览网页,看到这段代码,就粘贴过来了。

<!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=gbk" />     <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> 

读书人网 >Web前端

热点推荐