The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Find The Top Of An HTML Element With JavaScript

TODO: Pull subtitle into page object

This is some spacing

This is some spacing

This is some spacing

This is some spacing

this is the thing

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Find The Top Of An HTML Element With JavaScript


-- html

<p>This is some spacing</p>
<p>This is some spacing</p>
<p>This is some spacing</p>
<p>This is some spacing</p>

<div id="thing">this is the thing</div>

-- script

document.addEventListener("DOMContentLoaded", () => {
  let elem = document.querySelector("#thing")
  let rect = elem.getBoundingClientRect()
  console.log(rect.y)
})





-- metadata
-- date: 2024-01-17 01:19:41
-- id: 2b4rudri
-- type: css-experiment 
-- status: published