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

192
Views
Element height won't change with getBoundingClientRect()

I'm trying to resize the height of an element by using Element.getBoundingClientRect(). The height of the element was logged before and after element_box.height += 50; where the computed height does change. Yet, the height of the element doesn't change on the page. Why does div height remain 120px when it's suppose to be 170px?

https://jsfiddle.net/sxm2gn48/1/

<div></div>
div {
  border: 1px solid;
  height: 120px;
  width: 130px;
}
let div = document.querySelector("div");

window.addEventListener("load", function(event) {
    const element_box = div.getBoundingClientRect();
    element_box.height += 50;
})
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!