Hey everybody I want to let you know that I have undertaken the grueling task of getting the heck away from WordPress. I was so sick of the problems and updates I had to do all the time. I am now using my ezbloo system and I am integrating all my old posts into the new system. It sucks, but in the end, I will save bundles of time. I needed to keep things simple and that is why I created ezbloo. I'll have more on this later for you guys after I am done with the total integration of my old posts here. So if you are looking for a post and need it faster, shoot me an email and I will make it a priority. [email protected]

JavaScript document.getElementById Edit Background Color

We can use JavaScript like CSS to style a div element on a page to edit the background color. Lets say that you have a div id on a page called "topright" and you wanted to change the color to red with JavaScript.
<div id="topright"></div>

Use the code below to change the color to red with JavaScript.

<script>
document.getElementById("topright").style.backgroundColor = "red";
</script>

Change the color of a div to blue with JavaScript

[code lang="js"]<script> document.getElementById("topright").style.backgroundColor = "blue"; </script>

Change the color of a div to green with JavaScript

[code lang="js"]<script> document.getElementById("topright").style.backgroundColor = "green";</script>

JavaScript document.getElementById Edit Background Color

One of the best ways to learn is by tearing apart the code piece by piece to see what each character is doing. Take advantage of this code and remove parts to see what it does and then paste it back in.  That is the best way to learn JavaScript document.getElementById Edit Background Color