compuhelpindia.com

JavaScript Statements

Compuhelpindia.com
« Previous                                                                                                                                        Next Chapter »


JavaScript is a sequence of statements to be executed by the browser.
Examples in each Chapter
Example:
<!DOCTYPE html>
<html>
<body>
<h1>My Web Page</h1 >
<p id="myPar">I am Compuhelp</p >
<div id="myDiv">I Am in Chandigarh.</div>
<p>
<button type="button" onclick="myFunction()">Check Here</button>
</p>
<script>
function myFunction()
{
document.getElementById("myPar").innerHTML="Hello Students";
document.getElementById("myDiv").innerHTML="How are you?";
}
</script>
<p>When you click on "Check Here", the two elements will change.</p >
</body>
</html>

My Web Page

I am Compuhelp

I Am in Chandigarh.

When you click on "Check Here", the two elements will change.