Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get coords of html element js

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