HTML and CSS Reference
All the executable content elements we've discussed so far have had one
common trait: they are separate from the browser and the HTML/XHTML
documentseparate data, separate execution engine.
throughout your documents, either as blocks of code or as single state-
statements you provide to do such things as alter the appearance of the
document, control the display, validate and manipulate form elements,
and perform general computational tasks.
your documents, but we ask that you turn to topics like the companion
12.3.1. The <script> Tag
XHTML standard <script> tag.
The browser processes everything between <script> and </script> as
XHTML within this tag; the browser flags it as an error.
However, browsers that do not support <script> process its contents as
regular HTML, to the confusion of the user. For this reason, we recom-
mend that you include the contents of the <script> tag inside HTML com-
ments, just like CSS <style> rules: