Link to home
Create AccountLog in
JavaScript

JavaScript

--

Questions

--

Followers

Top Experts

Avatar of thenelson
thenelson

Reset (clear) bgcolor of a table element
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.

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
Avatar of COBOLdinosaurCOBOLdinosaur🇨🇦

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of thenelsonthenelson

ASKER

I knew it was simple. Thanks!

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

JavaScript

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.