To avoid parsing the symbols <> &, it is added in <script>…</script>. It is not needed in HTML. Let us see how CDATA is added in <script> tags:
<script> //<![CDATA[ document.write(">"); //]]> </script>
Note: CDATA is now deprecated. Do not use.
The CDATA Section interface is used within XML for including extended portions of text. This text is unescaped text, like < and & symbols. These symbols do not want to escape.
It is used like this:
<![CDATA[ ... ]]>