.NET中过滤TextBox中输入的html标签

前台过滤方法

function stripHTML(html)  
       {  
           return html=html.replace(/<[^>]*>/g, "");  
       }  
//调用stripHTML过滤html标签,然后赋值当前TextBox即可  
       function returnResult() {  
           document.getElementById("txtRemarks").value = stripHTML(document.getElementById("txtRemarks").innerHTML);   
       }  

  

posted @ 2012-11-28 11:45  ishibin  阅读(202)  评论(0编辑  收藏  举报