我正在創建一個網站的移動版本,並使其工作良好我需要從頁面上的某些標籤中刪除「樣式」屬性。如何從標籤中刪除樣式屬性?
例子:
<div class="gallery-arrows" style="top:85px;"></div><h8 style="top:85px;"><a href="https://twitter.com/TeamTHCRacing" style="color:#ffffff;">THC Racing on Twitter!</a></h8>
,我需要爲:
<div class="gallery-arrows"></div><h8><a href="https://twitter.com/TeamTHCRacing" style="color:#ffffff;">THC Racing on Twitter!</a></h8>
有什麼我可以添加刪除它們?像腳本或其他東西?
謝謝!
參見[的removeAttribute()方法(https://developer.mozilla.org/en-US/docs/Web/API/Element.removeAttribute) – Boaz