Javascript Reference
Categories: Element

javascript Element removeAttributeNS( )

@March 15, 2008, 1:22 a.m.
removeAttributeNS( )Firefox/Netscape/NN 6 IE n/a Chrome/Safari/DOM 2  

removeAttributeNS("namespaceURI", "localName")

  

Removes the local-named attribute with a matching namespace URI from the current element. This method works like removeAttribute( ) but accommodates attributes for XML documents that are labeled according to a namespace specification. The following simple XML document uses a namespace for an attribute of the libBook:title element:

<?xml version="1.0" encoding="ISO-8859-1">
<results xmlns:libBook="http://catalog.umv.edu/schema">
<libBook:title libBook:rareBooks="true">De Principia</libBook:title>
</results>?

To remove the value of the libBook:rareBooks attribute, the method for the element would include the removeAttributeNS( ) method call with the following parameters:

removeAttributeNS("http://catalog.umv.edu/schema", "rareBooks")
 
Parameters
 
  • URI string matching a URI assigned to a label earlier in the document.
  • The local name portion of the attribute.
 
Returned Value

None.


Powered by Linode.