Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get html element coords in js

const getElementCoords= (documentElement)=>{
  const elementAttributes= documentElement.getBoundingClientRect();
  
  return {
    "x": elementAttributes.x,
    "y": elementAttributes.y
  }
}
 
PREVIOUS NEXT
Tagged: #html #element #coords #js
ADD COMMENT
Topic
Name
1+2 =