首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2012-10-25 
求一 js 方法 :font stylecolor:rednew/font保留new求一 js 方法 :font stylecolor:rednew/f

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

热点排行