...
One reason could be to make a menu which has drop down subsection divs. It would also be useful for many other problems.
How can we do this?
We can set the CSS position style to absolute. Then we can make use of the method getBoundingClientRect to find the co-ordinates of an element we want to move our div to. Then it’s just a bit of simple math to calculate where to move it to.
...