HTML 參考手冊(cè)
刪除頭部元素的 style 屬性:
刪除屬性前:
刪除屬性后:
?removeAttribute() 方法刪除指定的屬性
查看類似方法 removeAttributeNode() 。
所有主要瀏覽器都支持 removeAttribute() 方法
參數(shù) | 類型 | 描述 |
---|---|---|
attributename | String | 必需。規(guī)定要?jiǎng)h除的屬性的名稱。 |
沒(méi)有返回值。
DOM 版本 | Core Level 1 Element Object |
---|