您好!欢迎来到云资源!本站资源24小时自动发货,海量精品课程资源免费下载!

html中实现文本框出现提示功能的多种方法

可以用html5中的属性 < input ="text" placeholder="你想输入的内容" > 也可以用js做到 加css样式 代码如下: .in_search { border:...

 可以用html5中的属性 < input ="text" placeholder="你想输入的内容" >

也可以用js做到 加css样式

代码如下:
<style type="text/css">
.in_search {
border:1 none;
color:#999999;
float:left;
font-size:14px;
height:18px;
line-height:18px;
margin:3px 2px;
width:253px;
}
</style>
<input name="q" class="in_search" onfocus="if(this.value=='请输入你想要输入的内容'){this.value='';}" onblur="if(this.value==''){this.value='请输入你想要输入的内容';}" type="text" value="请输入你想要输入的内容"/> 
开通vip
首页 导航 会员 客服 微信
QQ 微信 邮箱 TOP