C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Javascript »

Changing Back Ground color of the Page


Posted Date: 02 Jul 2009    Resource Type: Code Snippets    Category: Javascript
Author: Miss Meetu ChoudharyMember Level: Diamond    
Rating: 1 out of 5Points: 18



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

For more details, visit http://www.msdotnetmentor.com/?p=566



Responses

Author: Manigandan    03 Jul 2009Member Level: Gold   Points : 1
Its a Simple Program..

But a Good One.

Keep Posting your Favorite Editor's program?

What will be next language?
Telugu or Malayalam.
Better i will post this in Poll? :-)

Thanks,
Mani


Author: Miss Meetu Choudhary    03 Jul 2009Member Level: Diamond   Points : 2
Hi Manigandan,

Why i can't post simple programs all the simple programs are not copy righted. I will post some simple programs for some days....

I am giving a break to my Editor's Program and then will post some other Editor's as they take lots of time and searching involved in creation of a perfect code i never post non executable codes.


++
Thanks and Regards
Meetu Choudhary
Site Coordinator





Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Change DropDownList's SelectedText colour using JavaScript
Previous Resource: MouseOver sound using JavaScript
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use