Answers for "how get height elemnt with that margin in js"

0

how get height elemnt with that margin in js

//get the margin of an element,
// {{ use the getComputedStyle() method  }}
let box = document.querySelector('div');  // my div
let style = getComputedStyle(box);        // my div style


// all side margin
let marginLeft = parseInt(style.marginLeft);
let marginRight = parseInt(style.marginRight);
let marginTop = parseInt(style.marginTop);
let marginBottom = parseInt(style.marginBottom);
Posted by: Guest on November-18-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language