Home Answers Viewqa Java-Beginners Javascript background color

 
 


IRFAN ALI
Javascript background color
1 Answer(s)      4 years and a month ago
Posted in : Java Beginners

View Answers

May 15, 2009 at 12:16 PM


Hi Friend,

If you want to change the background color of the textbox, try the following code:

<html>
<head>
<title>Change background Color</title>
<script type="text/javascript">
function check(){
if (document.getElementById('in').value=="amit"){
document.getElementById('in').getAttributeNode('class').value="correct";
}else {
document.getElementById('in').getAttributeNode('class').value="incorrect";
}
}
</script>
<style type="text/css">
.correct{
background:#00ff00;
}
.incorrect{
background:#f00f00;
}
</style>
</head>

<body>
<p>
<input id="in" type="text" onkeyup="check();" class="incorrect"/>
</p>
</body>
</html>

Thanks









Related Pages:
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
Javascript background color - Java Beginners
Javascript background color  Hi How to compare background color...; Hi Friend, If you want to change the background color of the textbox, try the following code: Change background Color function check
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
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... the background color after every 5 seconds. Here is the code
Change background color of text box - Java Beginners
Change background color of text box  Hi how can i change the background color to red of Javascript text box when ever user enters an incorrect value while on entering a correct value its background color should change green
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
div background color in html
div background color in html   How to change the background color of DIV in HTML
HTML document's background color
HTML document's background color  How to set a HTML document's background color
uiscrollview background color
uiscrollview background color  Is it possible to set the uiscrollview background color in iPhone application
UITextfield Background Color
is ..it's showing a background color. Though my text field color is white. Can you please suggest.. , how can i remove the background color of text field. Thanks!   iPhone UITextField Background Color Set the text field background color
changing uiview background color
changing uiview background color  changing UIView background color in ios   self.view.backgroundColor = [UIColor colorWithRed:244.0f/255.0f green:230.0f/255.0f blue:183.0f/255.0f alpha:1.0f
jframe background color not showing
jframe background color not showing  jframe background color is not showing. please suggest.   Just add the background color to JPanel and then add it to JFrame. For example .. JFrame myFrame = new JFrame(); JPanel
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... the background color of table.  Code : <!DOCTYPE html PUBLIC "
Javascript change textbox background
Javascript change textbox background In this section, you will learn how to change the background of textbox. Here we have created a textbox and allowed...' then the background changed to green otherwise it will remains red. Here is the code
UIWebView Background Color
UIWebView Background Color If you wanted to change the background color on UIWebView in iPhone SDK, then you required to set the background color of UIWebView...). Where as setBackgroundColor will allow you to change the color of background area
changing Background Color
changing Background Color   ... change background color of a pdf file. You can change the background color... color) to set the background color of that chunk. Here we pass
pdf background color
pdf background color      ... the background of the pdf file as well as the size of a pdf file irrespective of the fact... the background of the pdf file which you have built. To make a program over
How to set the Gradient Color as a background color for Java Frame?
How to set the Gradient Color as a background color for Java Frame?  How to set the Gradient Color as a background color for Java Frame
UITableView Background Color
UITableView Background Color To change the background color of UITableView...]; The above line will change the default background color into gray color. You can... Selected Background Color UIImageView *selectedBackground = [[UIImageView
how to color the Eclipse editor background programmatically?
how to color the Eclipse editor background programmatically?  I have to color specific portion(background) of the of the Eclipse editor by running... as start line number and end line number and do the color in background portion
Background color blocks all labels and textfields
Background color blocks all labels and textfields  I added background color but I dont see textfields and labels anymore, please help. What am I missing? (" JFrame f = new JFrame(); SchoolOption f1 = new SchoolOption(); Color c
Add color to background but I can't labels or textfields
Add color to background but I can't labels or textfields  Please help... = new JFrame(); SchoolOption f1 = new SchoolOption(); Color c = new Color(128,0,0); Container con = f.getContentPane
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
how to create menubar and the below background color/image in java swing
how to create menubar and the below background color/image in java swing  how to create menubar and the below background color/image in java swing
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... : In this Example, We will create a Custom Tag which changes the background color
How to design a background, design a background, a background
color: First set the foreground and background color. Clouds: Go to Filter menu... How to design a background       If you don't have background, don't worry because you will learn here
JSP Background Image
JSP Background Image   ... to create JSP Background Image on your login page.  Understand with Example In this section, you will learn how to display the background image. You can see
Jbutton[] background & foregroundcolor change
foreground and background color is changed. the remaining jbutton foreground and background color are not changed. next i select button[9] then the button[5] foreground and background color is set to default color and the selected jbutton[9
How to set pdf background color.
How to set pdf background color. In this example, you will see how to set back ground color of pdf in struts2.  index.jsp <html> <...;/title></head> <body> <p>Background of file
div style background
div style background  How to add background color to a div? What is the code of div style background?   Hi, You can use the following code: <div style="background-color: #ccffcc;"> <p>Content</p> <
How to make a chrome background, make a chrome background, chrome background
background so follow all the steps as given in this example. New Document: First take a new document with any color background and fill "White" color... How to make a chrome background     
JList Background Images..Urgent
JList Background Images..Urgent  I has done a JList that can change background color when i selected each of it, but if i want to change background image rather than background colors, how can i do it? Please help! my previous
background
background  how to add image as background to a frame
Set Background Colors and Images in HTML
to set a background color in HTML. In this Tutorial, the code describe you an example that helps you to set background color in HTML. The code begin...;bgcolor> in HTML depicts you the color background of web page.    
Filling Color in Excel Using JSP
a sheet  and then  fill background color ,pattern and forground color... is used to fill the background color. You can be used the following fields... and background color .Then at last we add the style sheet into cellls and finally we add
uitableviewcell selected color
uitableviewcell selected color  HI, How to add uitableviewcell selected color? Thanks   Hi, Here is the code: UIView *viewSelected... UITableViewCell background image also. Thanks
changing selection color of <button>
valign=middle > <figure> <button style="background-color:black...changing selection color of   dear all, i have loaded image in border less button tag when button is selected with tab key i get brown color
Photoshop Tutorial :background image
Make a Bullet Background       This example is about a bullet background, normally you use background with color and any image. But with this tutorial, you can learn and design your
How to design a beautiful background with flowers, design a beautiful background with flowers, beautiful flowers background
How to design a beautiful background with flowers  ... to design a beautiful background of the flowers. New File: Start this example with a new document. Color: Choose Pen tool (P key
to change the styleclass color of <apex:outputlabel > onclick button function in javascript
, then through javascript how can we change the color of outputlabel to red color .my { color: Black; font-size: 10px; font-family: Arial...to change the styleclass color of onclick button function in javascript 
HTML Color Code for White
HTML Color Code for White In this page you will find the hexadecimal color code for White color. The hexadecimal color code for white is #FFFFFF or #ffffff. For most website white color is used as the background of the web page
How to make a rays background effect
How to make a rays background effect Let's go to draw a lighting rays background. New File: Take a new file with any size as you like. Take color: First take background and foreground color. Fill color: Fill color
javascript - Java Beginners
{color:white;} body{ background-color:#D2B48C;} td{text-color:#400000...javascript  please send me javascript validation a.first:link { color: green;text-decoration:none; } a.first:visited{color:green
JavaScript toSource
JavaScript toSource method          JavaScript toSource() method is usually used by the JavaScript internally not explicitly
Javascript validation - Java Beginners
in first attempt, the background color of text box changes to green while I... background color should't change,if user enters invalid sip code then then text box's background color should change to red and then on entering valid zip code
iphone Button Action (changing background of window)
iphone Button Action (changing background color of window)   In this tutorial we will change the background color on clicking the button...;setOrangeColor" as the setter function. The IBAction methods set the background color
Setting a Background image for UITableView in iPhone & iPad application.
Setting a Background image for UITableView in iPhone & iPad application. ... the listing. But the it looks very simple.. (white color). Though i can change... at background. So, to wrap up my question is short ..... i need to set an image
Set Color in JOptionPane
following key value pair, we have set the background color for JOptionPane... Set Color in JOptionPane       In this section, you will learn how to set color in JOptionPane. Now to do
Color Picker in Flex
the color picker component, the HBox component's background will change...Adobe Flex Color Picker: A color picker helps users to select a color of their own choice. A color picker is a component which displays a set of color

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.