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
Onclick event creates element with locked size

When I press the button, it will create the element but even though it says it's parent is document.body, the size of the element created is locked to the size of the parent element of the button. the problem shown

function example() {
  let go = document.getElementById("here");
  let toappend = new DOMParser().parseFromString(`<div style="background-color: red; width: 50px; height: 50px;">shouldnt be able to go outside of the bounds of the div the button was in.</div>`, "text/xml");
  go.appendChild(toappend);
}
<div id="here"></div>
<div style="width:200px; length:200px;">
  <button onclick="example()">press this</button>
</div>

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!