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

238
Vistas
How to access tailwind classes from a javascript file

I've just started with tailwind-css and I am trying to change the color of a HTML element using tailwindcss.

This is the HTML code - <h1 id="demo" class="text-3xl font-bold tracking-wide text-center">Hello</h1>.

And this is the Javascript code - document.getElementById("demo").style.color = "text-blue-600";.

vanilla CSS works but I am not able to access the tailwind utility classes.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use npm install -D tailwindcss@latest postcss@latest autoprefixer@latest or use <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet"> but using the tag won't benefit alot so its better to install it with NPM

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