C#代码
foreach( Control childControl in this.Controls )      
{      
   if( childControl is TextBox ){   
        ((TextBox)childControl).Text = "";      
     }      
}
Js代码
function ClearAllTextBox()      
{      
  var obj=window.document.forms[0];      
  for(i=0;i<obj.elements.length; i++)      
  {      
  var elem=obj.elements[i];       
  if(elem)      
  {      
    if(elem.type=="text"){      
       elem.value=""; }      
   }      
  }      
}    

相关文章:

  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2021-12-01
  • 2022-12-23
猜你喜欢
  • 2021-05-18
  • 2021-08-29
  • 2021-07-21
  • 1970-01-01
  • 2021-08-03
相关资源
相似解决方案