1. 開発者向けのウェブ技術
  2. Web API
  3. Element
  4. removeAttributeNS()

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

Element: removeAttributeNS() メソッド

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015年7月⁩.

removeAttributeNS()Element インターフェイスのメソッドで、要素から指定された属性を取り除きます。

構文

js
removeAttributeNS(namespace, attrName)

引数

  • namespace は文字列で、属性の名前空間を示します。
  • attrName は文字列で、現在のノードから取り除く属性の名前を示します。

返値

なし (undefined)。

js
// 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" />

仕様書

Specification
DOM
# ref-for-dom-element-removeattributens1

ブラウザーの互換性

Firefox 3 以降では、このメソッドは DOM 値を既定値にリセットします。

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /