w3schools
  
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About

XML DOM removeNamedItem() Method


NamedNodeMap Object Reference Complete NamedNodeMap Object Reference

Definition and Usage

The removeNamedItem() method removes the specified node.

If the removed attribute has a default value, a new attribute immediately appears containing the default value as well as the namespace URI, local name, and prefix, if any.

This method returns the removed node.

Syntax

removeNamedItem(nodename)

Parameter Description
nodename The name of the node to remove
 

Example

The following code fragment loads "books.xml" into xmlDoc using loadXMLDoc(), loops through the <book> elements and removes the category attributes:

Example

xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName('book');

for(i=0;i<x.length;i++)
{
x.item(i).attributes.removeNamedItem("category");
}

Try it yourself »

NamedNodeMap Object Reference Complete NamedNodeMap Object Reference

DreamTemplate

WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
FREE Web Hosting
Top Web Hosting
Cheap UK Web Hosting
WEB BUILDING
XML Editor – Free Trial!
FREE Flash Website
FREE Web Templates
SEO Company
EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification
STATISTICS
Browser Statistics
Browser OS
Browser Display
FLIGHT TICKETS
Find the cheapest flight
to any destination now!
SHARE THIS PAGE