我的html中有以下代码:
<p id='foo' style='text-align:center; font-size:14pt; font-family:verdana; color:red'>hello world</p>
and that in my external css:
#foo{ font-size:11pt; font-family:arial; color:#000; }
我想删除style
atribute中的所有font-size
和font-family
,但不删除外部css中的color
和其他设置.
Result expected:
<p id='foo' style='text-align:center; color:red'>hello world</p>
100
$('#foo').removeAttr('style'); // That removes all inline
$('#foo').css('font-family',''); // That remove the css setted too