我想循環訪問子元素並刪除/修改某些樣式屬性。我的div是動態生成的,我可以訪問它的ID。我的DIV可以查找並替換子元素的樣式屬性
<div id="headline" style="position">
<div style="text-align: center;">
<b style="color: rgb(255, 204, 153);"><font size="5">Expansion Pack</font></b>
</div>
</div>
或
<div id="headline" style="position">
<div style="text-align: center;">
<span style="color: rgb(255, 204, 153);">
<font size="4">Expansion Pack</font>
</span>
</div>
</div>
我想從標題的子元素更改字體大小或顏色。
我知道怎麼讀父DIV
$('#headline').find('*').each(function() {
// do stuff
});
裏面的所有元素,但我怎麼能找到樣式屬性的顏色和改變顏色或找到字體大小和更改字體的大小。
工作使用jQuery'的.css()'。 [檢查文檔](http://api.jquery.com/css/)。 – kosmos