html中实现文本框出现提示功能的多种方法
2016-06-23来源:

可以用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=请输入你想要输入的内容/>

2025公考·省考培训课程试听预约报名

  • 报班类型
  • 姓名
  • 手机号
  • 验证码
推荐信息
Baidu
map