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

149
Views
How to get class list of the <HTML> element?

I would like to access the class list of the html element (that is in this case I'd like to know if my-class is set on html):

<html class="my-class">
...
</html>

How can I do that with JavaScript?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Select the element and then classList:

document.querySelector('html').classList or if you have multiple clsases in your element then you can select by class to get the other classes from this element too. document.querySelector('.my-class').classList

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!