getAttributeNodeNS

書式

obj.getAttributeNodeNS(namespace,attrName)

属性

パラメータ 内 容
namespace 名前空間識別子
attrName 属性名

対応

[Firefox 1〜][Safari 1〜][Opera 8〜][Netscape 6〜]

説明

指定された名前空間の属性ノードを返します。

サンプルコード [実行]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=shift_jis">
<title>Sample</title>
<script type="text/javascript"><!--
function getAttrNodeNS() {
var bgColorNode = document.body.getAttributeNodeNS(null,"bgcolor");
bgColorNode.value = "orange";
var buttonNode = document.getElementById("myButton").getAttributeNode(null,"value");
buttonNode.value = "OK";
}
// --></script>
</head>
<body bgcolor="#fffff0">
<h1>getAttributeNodeNS</h1>
<form>
<input type="button" id="myButton" value="Click" onClick="getAttrNodeNS()">
</form>
</body>
</html>