>  Q&A  >  본문

jquery清除input type为password?

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

phpcn_u251phpcn_u2512751일 전921

모든 응답(2)나는 대답할 것이다

  • 数据分析师

    数据分析师2017-10-01 00:45:43

    jquery 입력 유형을 비밀번호로 지우시겠습니까? -PHP 중국 웹사이트 Q&A-jquery에서 입력 유형을 비밀번호로 지웁니다. -PHP 중국어 홈페이지 Q&A

    꼭 보고 배워보세요.

    회신하다
    0
  • 阿神

    阿神2017-03-10 14:12:26

    可以试下

    <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
  • 취소회신하다