DOM

Element.removeAttributeNS() メソッド

 編集:2022.09.23 by T.A.

[Edge]。→

element の指定された名前空間を持つ指定属性を削除します。

構文
element.removeAttributeNS(namespace, attrName)
element Element
namespace 属性の名前空間を示す文字列です。
attrName 削除する属性の名前を示す文字列です。
戻り値

なし(undefined)。

// Given:
//   <div id="div1" xmlns:special="http://www.mozilla.org/ns/specialspace"
//     special:specialAlign="utterleft" width="200px" />
d = document.getElementById("div1");
d.removeAttributeNS("http://www.mozilla.org/ns/specialspace", "specialAlign");
// Now: <div id="div1" width="200px" />

テスト