Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get html element coords with 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
3+7 =