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

151
Views
how to get the width of the HTML element

I'm making an image slider so I want to get the width of the image so I can use translate and move the images when I use element.clientWidth or any property that can get the width sometimes working and sometimes not I don't know the reason

here is my code

    const slideImages = document.querySelectorAll('.image-slider img');
    let distanceToMove = slideImages[0].clientWidth;

when I log it in the console sometimes it bring me the DOM Object and others the tag itself

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!