JavaScript Comments
Comments can be added to explain the JavaScript, or to make the code more readable.
Single line comments start with //
Multi line comments start with /* and end with */.
Example:
// Write to a heading:
document.getElementById("h1").innerHTML="Welcome to Tutsclub.com";
/*
The code below will write
to a heading and to a paragraph,
and will represent the start of
my homepage:
*/
JavaScript Statements
JavaScript statements are "commands" to the browser.
The purpose of the statements is to tell the browser what to do.
Example:
document.getElementById("demo").innerHTML="Tutsclub";
This JavaScript statement tells the browser to write "Tutsclub" inside an HTML element with id="demo":
Credits:
I fond this tutorial on youtube. This tutorial is created by Thenewboston.
Watch Here The original uploaded video from authors website.
0 comments: