This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

createCDATASection

Summary

Creates a CDATA section that contains the specified text.

Method of dom/Documentdom/Document

Syntax

var cdataSection = document.createCDATASection(text);

Parameters

text

Data-type
String

The text to place inside the CDATA section.

Return Value

Returns an object of type DOM NodeDOM Node

The CDATA section node.

Examples

The following code example creates a CDATA section.

document.createCDATASection("My content");

Notes

The createCDATASection method is supported only for XML documents.

Related specifications

DOM Level 3 Core
Recommendation

See also

Related pages

Attributions