In the process of working with a database, I come across HTML that includes "spans" colored in different shades. An example would be:
<div id="RelevantDiv">the industry's standard <span style="background-color: red">dummy text ever since the 1500s, when an unknown printer took a galley</span> of type and scrambled it to make a type specimen book. It has survived not only five.</div>
While I want to maintain this coloring, I also aim to create a JavaScript function that can toggle the background color on or off. I attempted the following approach:
function HLtoggle()
{
var element = document.getElementById('RelevantDiv');
element.style.background = '#FFFFFF';
}
Unfortunately, this method doesn't work as the spans are obviously overriding the styling.