Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!