Valid XHTML 1.1 and JavaScript

When dynamically building HTML with inline JavaScript you HAVE to escape your JavaScript code with HTML comments in order to get it to validate as XHTML1.1 like the example below or else the HTML elements will cause the Validator to choke.

<script type="text/javascript">
<--
...
/* code goes here */
...
//-->
</script>

Comments