ホーム HTML CSS XML JAVASCRIPT   PHP SQL MORE...   リファレンス 事例集    

XML DOM documentElement プロパティ


Document オブジェクト Reference Document オブジェクト

定義と用法

documentElement プロパティは、文書のルートノードを返します。

構文

documentObject.documentElement


次のコードは、loadXMLDoc() を使用して xmlDoc に "books.xml" をロードし、 XML 文書のロケーションを表示します:

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.documentElement;

document.write("Nodename: " + x.nodeName + "<br />");
document.write("Nodevalue: " + x.nodeValue + "<br />");
document.write("Nodetype: " + x.nodeType);

出力:

Nodename: bookstore
Nodevalue: null
Nodetype: 1

試してください »

Document オブジェクト Reference Document オブジェクト