一段这样的Html包裹的文字:
var description="
\n\tdsfds\n
\n\n\tsdfdsf
alt=\"\" border=\"0\" />dsfdsfds\n
\n\n\t
\n\n
\n\tdssadasasdsaddfds
\n\n
要去除html标签,图片,换行,回车等
description = description.replace(/(\n)/g, "");
description = description.replace(/(\t)/g, "");
description = description.replace(/(\r)/g, "");
description = description.replace(/]*>/g, "");
description = description.replace(/\s*/g, "");
得到结果:dsfdssdfdsfssadasasdsaddfds