<script>, <style> is CDATA in HTML

To make it easier to author documents in plain text, HTML process <script> and <style> as CDATA

<!ENTITY % Script "CDATA" -- script expression -->
<!ENTITY % StyleSheet "CDATA" -- style sheet data -->

HTML 4.01 Strict DTD

This makes it impossible to serialize text containing end tag, try it yourself:

Instantiated from outerHTML:

What you load differs from what you've saved. This breaks live authoring. Fixed in XHTML.