If the position of the parent div is defined as relative, the position of the child Div is defined as absolute, then the style.left value of the child div is relative to the value of the parent Div, which is the same as offsetleft, except that:
1. Style.left returns a string, such as 28px,offsetleft returns a value of 28, it is convenient to use offsetleft if the obtained value is to be calculated.
2. Style.left is read-write, offsetleft is only readable, so to change the position of Div, can only modify Style.left.
3. The value of style.left needs to be defined beforehand, otherwise the value taken is null. and must be defined in the HTML, I have experimented, if defined in the CSS, the value of Style.left is still empty, this is the problem I just started to encounter, always do not get the value of Style.left.
The offsetleft is still available without having to define the div's position in advance.
The difference between Div.offersetleft and Div.left