[转载]Js小技巧||给input type=“password”的输入框赋默认值

 

     直接给 input type="password"的输入框赋值不行,由于安全因素,不允许对密码框赋默认值,只能通过键盘的方式输入值。而又要在密码框显示*密码,换个思路使用简单的js脚本即可实现这个效果。

[转载]Js小技巧||给input type=“password”的输入框赋默认值
    

[转载]Js小技巧||给input type=“password”的输入框赋默认值
<input type="password" />

<br /><input type="password"  />
<script type="text/javascript">

    function RZJ_SetPwd()

    {

      var txt1=document.getElementById("txtValue");

      var txt2=document.getElementById("txtPass");

      var txt3=document.getElementById("txtOkPass");

      txt1.value="";

      txt1.style.display="none";

      txt2.style.display="";

      txt3.style.display="";

      txt2.focus();

    }

    </script>
[转载]Js小技巧||给input type=“password”的输入框赋默认值
    

[转载]Js小技巧||给input type=“password”的输入框赋默认值

     直接给 input type="password"的输入框赋值不行,由于安全因素,不允许对密码框赋默认值,只能通过键盘的方式输入值。而又要在密码框显示*密码,换个思路使用简单的js脚本即可实现这个效果。

[转载]Js小技巧||给input type=“password”的输入框赋默认值
    

[转载]Js小技巧||给input type=“password”的输入框赋默认值
<input type="password" />

<br /><input type="password"  />
<script type="text/javascript">

    function RZJ_SetPwd()

    {

      var txt1=document.getElementById("txtValue");

      var txt2=document.getElementById("txtPass");

      var txt3=document.getElementById("txtOkPass");

      txt1.value="";

      txt1.style.display="none";

      txt2.style.display="";

      txt3.style.display="";

      txt2.focus();

    }

    </script>
[转载]Js小技巧||给input type=“password”的输入框赋默认值
    

[转载]Js小技巧||给input type=“password”的输入框赋默认值

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-06-03
  • 2022-12-23
相关资源
相似解决方案