欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

XML DOM getAttributeNS() 方法

定義和用法

getAttributeNS() 方法通過命名空間 URI 和名稱來獲取屬性值。

語法:

elementNode.getAttributeNS(ns,name)
參數(shù) 描述
ns 必需。規(guī)定從中獲取屬性值的命名空間 URI。
name 必需。規(guī)定從中取得屬性值的屬性。

實(shí)例

在所有的例子中,我們將使用 XML 文件 books_ns.xml,以及 JavaScript 函數(shù) loadXMLDoc()。

下面的代碼片段從 "books_ns.xml" 中的第一個(gè) <title> 元素中獲取 "lang" 屬性的值:

xmlDoc=loadXMLDoc("books_ns.xml");

x=xmlDoc.getElementsByTagName("title")[0];
ns="http://www.dbjr.com.cn/children/";

document.write(x.getAttributeNS(ns,"lang"));

以上代碼的輸出:

en