zoukankan      html  css  js  c++  java
  • 重置按钮的js写法

    <button type="button" onclick="ClearTextBox()">重置</button>

    <script>
     $("#createDateBegin").datepicker();
     $("#createDateEnd").datepicker();
     
     function ShowProjectDetail(id){
      window.showModalDialog("<s:property value='basePath'/>contacts/orgMgr!showProject?projectId="+id,null,"dialogHeight: 600px; dialogWidth: 800px;center=yes");
     }
     
     function ClearTextBox(){  
      $("#contactId").val("");
      var inputs = document.all.tags("INPUT");  
      for(var i=0; i < inputs.length; i++) {
        if (inputs[i].type == "text") {
        inputs[i].value = ""; }
       if (inputs[i].type == "checkbox") {
        inputs[i].value = null; }  
      }
        
      var inputs = document.all.tags("TEXTAREA");  
      for(var i=0; i < inputs.length; i++)  
      inputs[i].value = "";  
     }
    </script>

    ===============================================================

    $(function() {

     $("#resetBtn").button({icons : {primary : "ui-icon-tag"}});

     $("#resetBtn").click(function(){
      $(':input','#tagForm').not(':button, :submit, :reset').val('').removeAttr('checked').removeAttr('selected');
     });

    });

  • 相关阅读:
    算法复习:字符串
    【第五天打卡。
    【第四天打卡。
    【第三天打卡。
    第二天打卡。
    【唉
    配环境到崩溃系列
    所谓环境……
    【随便吐槽
    第四天。打卡。【偷懒了两天hhhh
  • 原文地址:https://www.cnblogs.com/guanghuiqq/p/2555199.html
Copyright © 2011-2022 走看看