Home Answers Viewqa JavaScriptQuestions change color of back ground using switch

 
 


moulika
change color of back ground using switch
1 Answer(s)      a year and 8 months ago
Posted in : JavaScript Questions

how to change back ground color according to day using switch case

View Answers

September 13, 2011 at 11:41 AM


<html>
<script language="javascript">
    function change(id)
    {

        switch (id)
        {
            case 'c1':
                document.body.bgColor = "red";
                break;

            case 'c2':
                document.body.bgColor = "green";
                break;

            case 'c3':
                document.body.bgColor = "yellow";
                break;    

            case 'c4':
                document.body.bgColor = "blue";
                break;

             case 'c5':
                document.body.bgColor = "pink";
                break;
        }
    }
</script>
<body>
<input type="button" id="c1" onclick="change(this.id)" value="Red"/>
<input type="button" id="c2" onclick="change(this.id)" value="Green"/>
<input type="button" id="c3" onclick="change(this.id)" value="Yellow"/>
<input type="button" id="c4" onclick="change(this.id)" value="Blue"/>
<input type="button" id="c5" onclick="change(this.id)" value="Pink"/>

</body>
</html>









Related Pages:
change color of back ground using switch
change color of back ground using switch   how to change back ground color according to day using switch case
iPhone Switch Changes Toolbar Color
iPhone Switch Changes Toolbar Color In this tutorial we will use Switch button to change the Color of Toolbar. The Switch is added through the Interface... for the Switch so that when click on Switch the color of the Toolbar changes
color change
color change  how to change the color in circle using scrollbar
back ground mechanism of jsf framework
back ground mechanism of jsf framework  what is back ground mechanism of jsf framework?   Hi Friend, Please visit the following link: JSF Tutorials Thanks   Thanks
change player dress color
change player dress color  Hai friends, Can we change player dress color using J2ME. Please provide me an code for this. I can able to attain three colors only. Send the code to mail id. vijaikiranit@gmail.com
Change Color and Font of text
Change Color and Font of text       This section illustrates you how to change color and font of text using TextAttributes class. A string is defined and the class
JavaScript change background color automatically
JavaScript change background color automatically In this section, you will learn how to change the background color of the web page automatically. Now..., we have used using the Math.random(). The window.setTimeout() function change
Java Servlet Change Background Color
Java Servlet Change Background Color You can provide an effective way to the web page by changing the background color of the web page. In servlet, you can do this by using javascript. Here, we are going to change the background color
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO...); System.out.println(); switch (question...("| Retrieve objects in an LinkedList container using an Iterator
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO...); System.out.println(); switch (question...("| Retrieve objects in an LinkedList container using an Iterator
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO...); System.out.println(); switch (question...("| Retrieve objects in an LinkedList container using an Iterator
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO...); System.out.println(); switch (question...("| Retrieve objects in an LinkedList container using an Iterator
Changing background color using JavaScript
Changing background color using JavaScript  Hi Sir Is there any way to change the background color using JavaScript ? Please mention code with your... below function to change the background color & call it wherever it needed
UIWebView Background Color
UIWebView Background Color If you wanted to change the background color... using UIColor. UIColor object represents color and opacity (alpha value). Where as setBackgroundColor will allow you to change the color of background area
how to change color of titlebar in java
how to change color of titlebar in java  pls help
jquery color picker plugin
color picker in your web page using jQuery plug-in. In the given below example... the skin of color picker using 'css' file. Third ,by attaching to an text field and using callback functions to update the color with field's value
Change Background color using Custom Tag
Change Background color using Custom Tag In this program, We will create a Custom Tag which changes the background color. JSP Custom Tags : Provide... according to your choice, this background color change is due to the custom tag
To change the color of text hyperlinks midway
To change the color of text hyperlinks midway   Is there a way to change the color of text hyperlinks midway through a page? If so, what code do I use
To change the color of text hyperlinks midway
To change the color of text hyperlinks midway   Is there a way to change the color of text hyperlinks midway through a page? If so, what code do I use
To change the color of text hyperlinks midway
To change the color of text hyperlinks midway   Is there a way to change the color of text hyperlinks midway through a page? If so, what code do I use
change color according to the database value
change color according to the database value  any one know how to get values from database ( 1 or 0 ) and according to that change the color ( red or green) of given list
HTML - table background color.
HTML - table background color. Description : Here, you will see how to specifies the table back ground color in html page. The <table > is a html...;HTML table back ground color.</h1> <table bgcolor="gray"
Switch
on the value of week, using the switch statement. class ... Switch       Sometimes it becomes cumbersome to write lengthy programs using if and if-else
Switch databases
Switch databases  How do you inter-change between relational databases without code changes
using switch,break and for loop
using switch,break and for loop  generate a 10 digit number and display the length of longest increasing series
using switch and break
using switch and break  generate a 10 digit number and display the length of longest increasing series
How to Changing Toolbar Color using iPhone Application ?
How to Changing Toolbar Color using iPhone Application ?  Hi, i have developing a small application to changing the toolbar color in iphone. But i... the online reference or example of how to change toolbar color in iPhone Apps
switch statement
switch statement   i want to write a java program that computes Fibonacci,factorial,string reversal and ackerman using switch case to run as a single program
changing Chunk Color
change the color of chunk color .This example tell you how you can change the color of chunk and how you can add fonts and gives the size of the fonts... changing Chunk Color     
MKMapView Change Red Pin Color
MKMapView Change Red Pin Color  MKMapView Change Pin Color Hi, in my iphone map view application, i displayed the image on annotation instead of custom pin. But however on click it changes to red color pin. Can any one please
The Switch statement
of week, using the switch statement. class Switch{  ...Switch       Sometimes it becomes cumbersome to write lengthy programs using if and if-else statements
Switch Statement
Switch Statement  How we can use switch case in java program ?   Note:-Switch case provides built-in multiway decision statement.It...); switch(days){ case 1: System.out.println("Sunday
using switch case
using switch case  Define a class MENU to perform the following operation depending upon the users choice using switch case 1)print square root... choice: "); int choice=input.nextInt(); switch(choice
Change the color of the selected tab
Change the color of the selected tab Swing provides different methods to give color effects which gives a presentable look to the components. In this section, you will learn how to change the color of the selected tab. For this, we have
Color
to create new colors, and predefines a few color constants (see below... monitors (and TVs) to create all colors using the RGB system.... White is (255, 255, 255) and black is (0,0,0). Color Constants Java
Change background color of text box - Java Beginners
Change background color of text box  Hi how can i change... while on entering a correct value its background color should change green... problem. Please try the code. Change background Color function
Filling Color in Excel Using JSP
filling color in excel using jsp   ...): This method is used to fill the for ground color of the style sheet. setFillPattern... a sheet  and then  fill background color ,pattern and forground color
How can I change UIButton title color?
How can I change UIButton title color?  Hi, I have a button in my iPhone/iPad application. I want to change the color of the text when user clicks..., You have to set the color of the button for a particular state say
How to change the color of a base64-encoded png image JQuery?
How to change the color of a base64-encoded png image JQuery?  I am going to change the colors of the pixels of a png image(which is in base64 format.... the original image is shown, but the color does not change. Do you know why
how to change div background color in javascript
how to change div background color in javascript  how to change div background color in javascript ?   <div id="Name">   <div class="content">      <h2>Your Name here</h2>       <p>First
changing Background Color
change background color of a pdf file. You can change the background color... the object of Color by using new Color(0xFF, 0xFF, 0x00). We are passing three...: setBackground(Color color):  If you want to change the background
store the image in the oracle using blob and get it back - JDBC
store the image in the oracle using blob and get it back  hi i am... but at time of reading it back it never shows me the image ..so plz try this code..."); blobTest.readBlob("1.gif"); } }   Hi friend, i am sending code using
using if and switch stmt - Java Beginners
using if and switch stmt  A cloth showroom has announced... be assumed. Write a program using "switch and if statement" to compute net amount...(); switch(menu) { case 1: System.out.print("Quantity: "); int q1 = scan.nextInt
servlet backgorund color change - JSP-Servlet
servlet backgorund color change  code for servlet that changes background color in every 10 seconds.  Hi Friend, Try the following code: import java.io.*; import java.sql.*; import java.util.*; import
change one type of color in between more colors
How to change one type of color in between more colors... to change one type of color in more than one color, It is so easy to make this example... color area to change another color. Color Balance: Now change the color
Switch case + condition??
Switch case + condition??  I try to use a switch case with condition...(); if (label.equals("Exit")) { destroyApp(true); } if (label.equals("Back")) { { // go back to menu Menu
how to change background color in dojo tab container - Framework
how to change background color in dojo tab container  how to change background color in dojo tab container
pdf background color
pdf background color       In this program we are going to tell you how we can change... will be created. After going through this tutorial you will be able to change
The Right Reasons for Change
The Right Reasons for Change     ... many more job opportunities today than a decade and a half back. As a result it is easier for people to switch to a better job, and job hopping has become
Change Background of Slide Using Java
Change Background of Slide Using Java   ... then change background of the slide. In this example we are creating an object... color and  foreground color  of the slide. Then finally add into slide

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.