Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cancel Background

Status
Not open for further replies.

alshebli

Programmer
Feb 22, 2005
10
US
So i have the following line of code:

document.myForm.elements['Last'].style.backgroundColor='#eeeeee';

which changes the input field's background in my form to light gray. However now I need to add this button that when you press on it, it changes everything back to normal.

So I did this:

document.myForm.elements['Last'+i].style.backgroundColor='#ffffff';

which turns the background color back to white, however this isn't exactly what i want. You see the input field is still kind of "deep and shadowy". I just want it to go back to plain old input text field.

So i guess my question is how to you undo a background property?
 

Why not see what it is set to before you change it by alerting:

Code:
alert(document.myForm.elements['Last'].style.backgroundColor);

and just set it back to whatever value is shown?

Dan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top