Monday, 16 July 2012
How to write javascript blocks
<!DOCTYPE html>
<html>
<body>
<h1>My Web Page</h1>
<p id="demo">A Paragraph.</p>
<p id="myDIV">A DIV.</p>
<button type="button" onclick="myFunction()">Try it</button>
<script type="text/javascript">
function myFunction()
{
document.getElementById("demo").innerHTML="Hello Boy";
document.getElementById("myDIV").innerHTML="How are you?";
}
</script>
</body>
</html>
Result:
My Web Page
A Paragraph.
A DIV.
This post was written by: Bharathi
Bharthi is a professional blogger, web designer and front end web developer. Follow him on Twitter
Subscribe to:
Post Comments (Atom)
0 Responses to “How to write javascript blocks”
Post a Comment