1. 程式人生 > >去除所有的 html標籤

去除所有的 html標籤

去除禁止輸入 html標籤

<script>

  //去除所有的 html標籤,得到Html標籤中的內容
  var strss ="<input>是大法官的鬼地方個地方</input><p><font face=宋體 color=#000000>&nbsp;&nbsp;&nbsp;</font></p> ";
  var strs = strss.replace(/<\/?.+?>/g,"");
  var str = strs.replace(/&nbsp;/g,"");//str為得到後的內容
  alert(str);

  </script>

判斷頁面id為loading標籤是否存在

if(typeof(eval("document.all.loading")) != "undefined"){
alert(id為loading的標籤不存在);
}