当前位置: 代码迷 >> JavaScript >> 求1 js 方法 :<font style="color:red">new</font>保留new
  详细解决方案

求1 js 方法 :<font style="color:red">new</font>保留new

热度:297   发布时间:2012-10-25 10:58:57.0
求一 js 方法 :<font style="color:red">new</font>保留new
求一 js 方法 :<font style="color:red">new</font>保留new

------解决方案--------------------
var value="<font style=\"color:red\">new</font>";
value=value.replace(/<\/?font[^<>]*>/gi,"")
alert(value)
------解决方案--------------------
JScript code

            var s = '<font style="color:red">new</font>';
            var r = />([^<]+)</g;
            alert( r.exec(s)[1] ) 
  相关解决方案