Changing BackGround Color using JavaScript
The following code shows how on button click event we can change the background color of the page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Changing the Backgound color on Button Click–Meetu</title>
<script language=”javascript” type=”text/javascript”>
function prog1()
{
document.bgColor=“red”;
}
function prog2()
{
document.bgColor=“green”;
}
</script>
</head>
<body>
<input id=”Button1″ type=”button” value=”green” onclick=”prog2()” />
<input id=”Button2″ type=”button” value=”red” onclick=”prog1()” /></body></html>
Thanks and Regards
Meetu Choudhary
Go Green Save Green
Popularity: 31%
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.


(2 votes, average: 4.50 out of 5)







Testing
?great work!
Shuby I would say cool one and intresting. not the great one as i have seen other posts bys her too. they are Great.
Leave your response!
You must be logged in to post a comment.
Member Area
Register | LoginWho's Online
Our Network
Most Popular Post
Most Viewed Posts
History
Top Members
Categories
Your opinions
Most Commented
Most Viewed