Continue

 Commenting Script Code

Though you will learn JavaScript with HTML, in a separate tutorial, but here you must make a note that if you are using Java Script or VB Script in your HTML code then it is recommended to put that script code inside proper HTML comments so that old browsers can work properly.


Example

<!DOCTYPE html> 

<html>

<head>

<title>Commenting Script Code</title>

<script>

<!--

document.write("Hello World!")

//--->

</script>

</head>

<body>

<p>Hello, World!</p>

</body> 

</html>


This will produce the following result:

Hello World!

Hello, World!

Comments

Popular Posts