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

74
Views
How to add pseudo elements to range slider thumb

When I have three files

test1.html

<script src="main.js" defer></script>
...
<div class="divOne"></div>

test2.html

<script src="main.js" defer></script>
...
<div class="divTwo"></div>

main.js

document.querySelectorAll('.divOne');
document.querySelectorAll('.divTwo');

Then I would get an error in the test1.html file that divTwo cannot be found. In test2.html I would get the error that divOne cannot be found.

How can I make JavaScript code optimal that I can include my JavaScript file for reusable components on any page, but if something doesn't exist because I don't use it in the file, nothing should happen?

about 4 years ago · Juan Pablo Isaza
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!