Through JavaScript, I want to find out how to find whether a span and a button are touching. I saw something, Element.getBoundingClientRect(). If that is the way to do it, how do I properly do it?
I've already attempted to use Element.getBoundingClientRect() but most likely not used it properly.
var span1 = document.getElementById("mySpan")
var button = document.getElementById("myButton")
if(touches(span1, button)){
...
}