Latest web development tutorials

HTML-DOM renameNode () -Methode

Document Object Reference Document Object

Beispiele

Umbenennen p Elemente:

var p=document.getElementsByTagName("P")[0];
document.renameNode(p,null,"h1");

Definition und Verwendung

renameNode () -Methode das vorhandene Element Knoten umbenennen oder Knotenattribut.


Browser-Unterstützung

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Es gibt keine großen Browsern renameNode () -Methode unterstützen.


Grammatik

document.renameNode( node , namespaceURI , nodename )

Parameter

参数 类型 描述
node Node 对象 必须。需要重命名的节点对象。
namespaceURI String 必须, 如果你不想指定可以设置 namespace URI的节点可以设置为 null
nodename String Required, the new nodename

Rückgabewert

类型 描述
Node 对象 重命名节点

Technische Details

DOM-Version Core Level 3 Document Object


Document Object Reference Document Object