<!-- JavaScript:Basics plus code snippet 1. -->
<!-- Use of CDATA section. -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- Code source: http://www.justfigures.co.uk/ -->
<!-- A resource for web developers using XHTML, CSS, JavaScript, PHP -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>View code snippet page</title>
</head>

<body>
<!-- The correct XML method to include a CDATA section -->
<!-- however many browsers have trouble with this -->
<script language="JavaScript" type="text/javascript">
<![CDATA[
var booleanTest1;
booleanTest1=(3<2);
document.write("The condition (3<2) is " + booleanTest1.valueOf());
document.write("<br />");
]]>
</script>

<!-- the current solution is to combine with JavaScript single-line comment notation -->
<script language="JavaScript" type="text/javascript">
//<![CDATA[
var booleanTest2;
booleanTest2=(4<2);
document.write("The condition (4<2) is " + booleanTest2.valueOf());
document.write("<br />");
//]]>
</script>
</body>
</html>