element.removeAttributeNS

<breadcrumbs></breadcrumbs>

== Summary ==

ๆฆ‚่ฆ

<code>removeAttributeNS</code> removes the specified attribute from an element. removeAttributeNS ่ฆ็ด ใ‹ใ‚‰ๆŒ‡ๅฎšใฎๅฑžๆ€งใ‚’ๅ–ใ‚Š้™คใใพใ™ใ€‚

In Firefox 3 and later, this method resets DOM values to their defaults. Firefox 3ไปฅ้™ใงใฏใ“ใฎใƒกใ‚ฝใƒƒใƒ‰ใฏDOMใฎๅ€คใ‚’ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆๅ€คใซใƒชใ‚ปใƒƒใƒˆใ—ใพใ™ใ€‚== Syntax ==

ๆง‹ๆ–‡

element.removeAttributeNS(namespace,attrName);

* <code>namespace</code> is a string that contains the namespace of the attribute. * <code>attrName</code> is a string that names the attribute to be removed from the current node.

  • namespace ใฏๅฑžๆ€งใฎๅๅ‰็ฉบ้–“ใ‚’ๅซใ‚“ใงใ„ใ‚‹ๆ–‡ๅญ—ๅˆ—ใงใ™ใ€‚
  • attrName ใฏ็พๅœจใฎใƒŽใƒผใƒ‰ใ‹ใ‚‰ๅ–ใ‚Š้™คใๅฑžๆ€งใฎๅๅ‰ใ‚’่กจใ™ๆ–‡ๅญ—ๅˆ—ใงใ™ใ€‚== Example ==

ไพ‹

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

ๆณจ่จ˜

DOM ใƒกใ‚ฝใƒƒใƒ‰ใฏ่ฆ็ด ใฎๅฑžๆ€งใ‚’ๅ–ใ‚Šๆ‰ฑใ„ใพใ™ใ€‚

ๅๅ‰็ฉบ้–“ใซ็„ก้–ขไฟ‚ใ€
ๆœ€ใ‚‚ไธ€่ˆฌ็š„ใซไฝฟ็”จใ•ใ‚Œใ‚‹ใƒกใ‚ฝใƒƒใƒ‰
ๅๅ‰็ฉบ้–“ใซ้™ๅฎšใ•ใ‚Œใ‚‹ๅค‰ๆ•ฐ
(DOM Level 2)
Attr ใƒŽใƒผใƒ‰ใ‚’็›ดๆŽฅๆ‰ฑใ† DOM ใƒฌใƒ™ใƒซ 1 ใฎใƒกใ‚ฝใƒƒใƒ‰
(ใปใจใ‚“ใฉไฝฟ็”จใ•ใ‚Œใชใ„)
Attr ใƒŽใƒผใƒ‰ใ‚’็›ดๆŽฅๆ‰ฑใ† DOM ใƒฌใƒ™ใƒซ 2 ๅๅ‰็ฉบ้–“ใซ้™ๅฎšใ•ใ‚Œใ‚‹ใƒกใ‚ฝใƒƒใƒ‰
(ใปใจใ‚“ใฉไฝฟ็”จใ•ใ‚Œใชใ„)
setAttribute (DOM 1) setAttributeNS setAttributeNode setAttributeNodeNS
getAttribute (DOM 1) getAttributeNS getAttributeNode getAttributeNodeNS
hasAttribute (DOM 2) hasAttributeNS - -
removeAttribute (DOM 1) removeAttributeNS removeAttributeNode -
== Specification ==

ไป•ๆง˜

DOM Level 2 Core: removeAttributeNS