/**
* jquery去除字符串中的html
* 示例:
* var a="<b>abc</b>";
* $.removeHtml(a);
* 结果:abc
*/
jQuery.removeHtml = function(s){
return (s)? jQuery("<p>").append(s).text(): "";
}
测试如下:
var a="<b>abc</b>";
a=$.removeHtml(a);
alert(a);
/**
* jquery去除字符串中的html
* 示例:
* var a="<b>abc</b>";
* $.removeHtml(a);
* 结果:abc
*/
jQuery.removeHtml = function(s){
return (s)? jQuery("<p>").append(s).text(): "";
}
var a="<b>abc</b>";
a=$.removeHtml(a);
alert(a);