Home > Web Front-end > JS Tutorial > body text

js下在password表单内显示提示信息的解决办法_表单特效

WBOY
Release: 2016-05-16 19:09:55
Original
1036 people have browsed it

经典有人要这个代码,考虑到password中输入的内容会显示为*号,所以要想办法解决*的问题。当初想用setAttribute动态修改type属性达到效果,再ff下测试成功,但没想到setAttribute对type属性的修改在ie中无效。最终采用背景图片的方式解决了这个。即为password设定一个背景图片,图片文字为提示信息
如:js下在password表单内显示提示信息的解决办法_表单特效,
当鼠标放上时不显示背景图片。
代码如下:


[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template