When using XHTML, the contents of <script> and <style> elements must be marked as CDATA. This is essential when serving XHTML correctly (as application/xhtml+xml).
When possible, use external script and style files and reference these from your XHTML document (behavioural and presentational separation). However, the examples below show how to place <script> and <style> inside your XHTML document correctly. This method should be compatible with older browsers, and therefore degrades gracefully.
Marking <script> as CDATA:
Marking <style> as CDATA:
<style type="text/css"> <!--/*--><![CDATA[/*><!-- */ ...... /*]]>*/--> </style>