welcome to Learning World,Worlds No.1 dastination for Learning. Stay With Us for New Updates and Follow us On FB and Google+.

Welcome to Free learning World Learning World: How to comment in java script

Search Here

Tuesday, November 8, 2016

How to comment in java script

How to comment in java script

JavaScript Comments
Not all JavaScript statements are "executed".

Code after double slashes // or between /* and */ is treated as a comment.

Comments are ignored, and will not be executed:
See this coding to understand
<!DOCTYPE html>
<html>
<body>

<h1>Comments are NOT Executed</h1>

<p id="demo"></p>

<script>
var x = 5;
// var x = 6; I will not be executed
document.getElementById("demo").innerHTML = x;
</script>

</body>


</html>

No comments:

Post a Comment