removeAttributeNS

書式

obj.removeAttributeNS(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 rmAttr() {
document.body.removeAttributeNS(null, "bgcolor");
}
// --></script>
</head>
<body bgcolor="#ff8f00">
<h1>removeAttribute</h1>
<form>
<input type="button" id="myButton" value="Click" onClick="rmAttr()">
</form>
</body>
</html>