Currently, I am attempting to display an information box when hovering over an element with the mouse. The issue I am facing is that the element moves, and I need to determine its left margin. However, the element does not have a margin-left property in CSS, and its position is relative, so adding a margin-left property is unnecessary. I experimented with using
element1.style.marginLeft = element2.style.marginLeft
, but it consistently returns a value of 0.