"<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>"
Quiero cambiar el color rgb (128,128,128) haciendo un script. Por favor ayúdame a solucionar esto
Puede usar este código javascript para cambiar todo el intervalo al color rgb preferido:
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>
También puede cambiar 'span' a cualquier elemento que desee seleccionar y cambiar.