日期:2014-05-16  浏览次数:20364 次

求一 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] )