Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

169
Vistas
Changing paragraph tag color by console

I want to get all the paragraph tags on a page to be white by putting something into the console. I tried something like this:

document.p.style.color = 'white';

but that did not work. I know changing the body tag works in the console tho

document.body.style.background = 'black';
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Here is an example code for your answer:

HTML:

<p id="ANYTHING_YOU_WANT">ANYTHING_YOU_WANT</p>

JS:

const VARIABLE_NAME = document.getElementById("ANYTHING_YOU_WANT");

VARIABLE_NAME.style.color = "aqua";

Give your class and text instead of ANYTHING_YOU_WANT and your variable name instead of VARIABLE_NAME...

about 4 years ago · Juan Pablo Isaza Denunciar

0

You would need to select paragraph individually or select them in bulk to change their properties.

Since there is only 1 body document.body works

But there can be multiple paragraphs so

You either need to select them by thier id `**

document.getElementById("Id")

**` or you could do **

document.querySelectorAll('p').forEach(p => p.style.color = 'white');**

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda