JavaScript
--
Questions
--
Followers
Top Experts
Reset (clear) bgcolor of a table element
To set the bgcolor of a table cell element using Java, I can use:
document.getElementById('t d_id').sty le.backgro undColor=' #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.
document.getElementById('t
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.
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
ASKER CERTIFIED SOLUTION
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
I knew it was simple. Thanks!






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
JavaScript
--
Questions
--
Followers
Top Experts
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.