|
説明
- HTMLタグ要素の要素名の値を持つプロパティ。
- 用例では,「id="TagName"」としてid名「TagName」を設定しているHTMLタグ要素の要素名である「code」の値を,「tagName」プロパティを使って取得し,書き出している。
- Internet Explorer4.Xは対応していない。
用例
<p> <code id="TagName"> document.write(document.getElementById("TagName").tagName); </code> <p> <script type="text/javascript"> <!-- document.write("HTMLタグ要素名:"); document.write(document.getElementById("TagName").tagName); //--> </script>