首页 >社区问答列表 >jquery清除input type为password?

jquery清除input type为password?

我试了.val("")和.attr("value","")的方法,但没有成功,对象获取上没问题的,因为用.attr成功改变了边框颜色,求助??

  • 数据分析师
  • 数据分析师    2017-10-01 00:45:432楼

    jquery清除input type为password?-PHP中文网问答-jquery清除input type为password?-PHP中文网问答

    围观一下哦,学习一下。

    +0添加回复

  • 回复
  • 阿神
  • 阿神    2017-03-10 14:12:261楼

    可以试下

    <html>
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <script src="jquery-2.1.1.min.js"></script>
     </head>
     <body >
    <input type="password" id="txtPwd" value="fsdafs">
    <script type="text/javascript">
    $(document).ready(function(){
    $("#txtPwd").attr("value","");
    });
    </script>   
     </body>
    </html>

    +0添加回复

  • 回复