1//get the margin of an element,
2// {{ use the getComputedStyle() method }}
3let box = document.querySelector('div'); // my div
4let style = getComputedStyle(box); // my div style
5
6
7// all side margin
8let marginLeft = parseInt(style.marginLeft);
9let marginRight = parseInt(style.marginRight);
10let marginTop = parseInt(style.marginTop);
11let marginBottom = parseInt(style.marginBottom);