CDATASection

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

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

In XML, a CDATA section looks like:

xml
<![CDATA[ … ]]>

For example:

xml
<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, ]]>.

Note: CDATA sections should not be used within HTML they are considered as comments and not displayed.

EventTarget Node CharacterData Text CDATASection

Instance properties

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

Instance methods

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

Specifications

Specification
DOM Standard
# interface-cdatasection

Browser compatibility

BCD tables only load in the browser

See also