Monday 16 July 2012

How to write javascript statements


<!DOCTYPE html>
<html>
<body>

<h1>My Web Page</h1>

<p id="demo">A Paragraph.</p>

<p id="myDIV">A DIV.</p>

<script type="text/javascript">
document.getElementById("demo").innerHTML="Hello Boy";
document.getElementById("myDIV").innerHTML="How are you?";
</script>

</body>
</html>

Result:

My Web Page

Hello Boy
How are you?

0 Responses to “How to write javascript statements”

Post a Comment