当前位置:主页 > 查看内容

常用input文本框内容自动垂直居中并默认提示文字单击为空

发布时间:2021-06-12 00:00| 位朋友查看

简介:三个功能: 1、内容自动垂直居中 2、默认提示文字显示灰色 3、单击后变为空 复制代码 代码如下: input type="text" name="wd1" id="qy_1" maxlength="100" style="color:gray;width:199px;height:30px;line-height:30px;" autocomplete="off" value="请输入……
三个功能:

1、内容自动垂直居中
2、默认提示文字显示灰色
3、单击后变为空

复制代码
代码如下:

<input type="text" name="wd1" id="qy_1" maxlength="100" style="color:gray;width:199px;height:30px;line-height:30px;" autocomplete="off" value="请输入企业名称" style="color:gray;" onfocus="javascript:if(this.value == '请输入企业名称') this.value = ''; this.style.color='gray';" onblur="if(this.value == '') {this.value = '请输入企业名称'; this.style.color = 'gray';}">

原文链接:https://m.jb51.net/web/88318.html
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:frameset(划分框窗)常用属性整理 下一篇:没有了

推荐图文


随机推荐