Javascript Example
This is simple program to show current date and time
<!DOCTYPE
html>
<html>
<body>
<h1>My
First JavaScript</h1>
<button
type="button"
onclick="document.getElementById('demo').innerHTML
= Date()">
dear
Click me to display Date and Time.</button>
<p
id="demo"></p>
</body>
</html>
Program
to change the content of html text
<!DOCTYPE
html>
<html>
<body>
<h1>What
Can JavaScript Do?</h1>
<p
id="demo">JavaScript will change HTML content.</p>
<button
type="button"
onclick="document.getElementById('demo').innerHTML
= 'Hello JavaScript!-i am the changed form.........'">
Click
Me!</button>
</body>
</html>
Stay happy with www.howiset.blogspot.com
No comments:
Post a Comment