The CDATASection is required when the document has to be parsed as XML. These situations are specific to XML based documents and are represented by CDATASection type. The CDATASection type inherits all properties and methods of TextType except splitText().

The CDATASection type has following characteristics:

  • nodeType : 4
  • nodeName : #cdata-section
  • nodeValue: contents of CDATA section
  • parentNode : Document or Element
  • childNodes : None
NOTE: Since the CDATASection is an XML element, all major browsers does not interpret it’s data correctly. Only a XML  document allows it’s creation using document.createCDATASection() and pass it to the node’s content.


›› go to examples ››