"<p><span style="color: rgb(255, 255, 255);">Beautifully hand designed brochure with arresting imagery created by the designers</span><em style="color: rgb(255, 255, 255);"> eminem.</em></p>"
"<p><span style="color: rgb(105,105,105);">Beautifully hand designed brochure with arresting imagery created by the designers</span><em style="color: rgb(255, 255, 255);"> eminem.</em></p>"
I want to change the rgb color (128,128,128) by making a script. please help me to solve this
You can use this javascript code to change all span to the preferred rgb color:
document.querySelectorAll('span').forEach(element => {
element.style.color = 'rgb(128,128,128)';
});
<p><span style="color: rgb(255, 255, 255);">Beautifully hand designed brochure with arresting imagery created by the designers</span><em style="color: rgb(255, 255, 255);"> eminem.</em></p>
<p><span style="color: rgb(105,105,105);">Beautifully hand designed brochure with arresting imagery created by the designers</span><em style="color: rgb(255, 255, 255);"> eminem.</em></p>
You can also change 'span' to whatever element you want to select and change.