Web/API/CDATASection

From Get docs


The CDATASection interface represents a CDATA section that can be used within XML to include extended portions of unescaped text. The symbols < and & don’t need escaping as they normally do when inside a CDATA section.

In XML, a CDATA section looks like:

<![CDATA[ ... ]]>

For example:

<foo>Here is a CDATA section: <![CDATA[ < > & ]]> with all kinds of unescaped text.</foo>

The only sequence which is not allowed within a CDATA section is the closing sequence of a CDATA section itself, ]]>:

<![CDATA[ ]]> will cause an error ]]>

Note that CDATA sections should not be used within HTML; they only work in XML.

Properties

This interface has no specific properties and implements those of its parent Text.

Methods

This interface has no specific methods and implements those of its parent Text.

Specifications

Specification Status Comment
DOMThe definition of 'CDATASection' in that specification. Living Standard Re-added in issue #295 due to web breakage
DOM4The definition of 'CDATASection' in that specification. Obsolete Removed in favour of the more generic Text interface
Document Object Model (DOM) Level 3 Core SpecificationThe definition of 'CDATASection' in that specification. Obsolete No change from Document Object Model (DOM) Level 2 Core Specification
Document Object Model (DOM) Level 2 Core SpecificationThe definition of 'CDATASection' in that specification. Obsolete No change from Document Object Model (DOM) Level 1 Specification.
Document Object Model (DOM) Level 1 SpecificationThe definition of 'CDATASection' in that specification. Obsolete Initial definition

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
CDATASection Chrome

Full support 1

Edge

Full support 12

Firefox

Full support Yes

IE

Full support Yes

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

?

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown