style="font-size:11.0pt;font-family:宋体;color:black"
怎么用js
写正则去掉style
中的所有font-size
得到如下:
style="font-family:宋体;color:black"
解决方案
style.replace(/font-size\s*:\s*[^;]*;?/g,'')
style="font-size:11.0pt;font-family:宋体;color:black"
怎么用js
写正则去掉style
中的所有font-size
得到如下:
style="font-family:宋体;color:black"
style.replace(/font-size\s*:\s*[^;]*;?/g,'')