如何在键入和检索数据时将文本框内容设置为DOTS

时间:2015-06-26 12:36:02

标签: javascript html css html5 css3

我想屏蔽我们应用程序中的文本框。但我们不能使用Textmod = Password,因为如果我们使用Textmode=Password我们无法在编辑模式下检索数据,我们无法将数据返回到文本框中保存。在这里,我想在输入时将文本框内容设为点,并希望将该类型内容检索为该文本框中的点。 我刚试过这段代码

-webkit-text-security: disc;-moz-text-security: disc;text-security: disc;

此代码在Chrome中有效,但在IE或Firefox中无效。

如何在IE和Firefox中实现相同的结果呢?

2 个答案:

答案 0 :(得分:0)

我猜你正在寻找这个。你可以在获取文本框中的值后更改文本属性。

Degrading -webkit-text-security

答案 1 :(得分:-1)

使用它,您将得到它。

<html>
<body>
<form method="post">
UserName
<input type="text" name="fname"/>
Password
<input type="password" name="lname"/>
</body>
</html>

This is what will come