<script>
and </script>
tags.<script>
tag to give external Javascript reference in HTML page<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = "My text comes from Javascript";
</script>
JavaScript can display output in different ways as listed below
let a, b, c; // Declare 3 variables
a = 5; // Assign the value 5 to a
b = 6; // Assign the value 6 to b
c = a + b; // Assign the sum of a and b to c
<script>
// Below code will change content of html tag whose id is heading1:
document.getElementById("heading1").innerHTML = "JavaScript Comments";
</script>
<script>
/*
The code below will change
the heading with id = "myH"
and the paragraph with id = "myP"
*/
document.getElementById("myH").innerHTML = "JavaScript Comments";
document.getElementById("myP").innerHTML = "My first paragraph.";
</script>