Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reset (clear) bgcolor of a table element

Posted on 2012-03-14
2
Medium Priority
?
318 Views
Last Modified: 2012-03-14
To set the bgcolor of a table cell element using  Java, I can use:
       document.getElementById('td_id').style.backgroundColor='#FF0000';
How do I reset, clear or remove the bgcolor so that the body bgcolor shows in the cell?  

I know I can set the cell's bgcolor to the same as the body but I want to avoid having to change the Java code if I change the body bgcolor.
0
Comment
Question by:thenelson
2 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 2000 total points
ID: 37720832
document.getElementById('td_id').style.backgroundColor='transparent';



Cd&
0
 
LVL 39

Author Closing Comment

by:thenelson
ID: 37721008
I knew it was simple. Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question