I'm currently using Vue.js for drag and drop functionality, specifically utilizing evt.to and evt.from to determine if I am dragging an element to list2. These event parameters return the HTML tree of my draggable element with the parent having the id "list2". I need to figure out how to track if evt.to contains the list2 element using plain JavaScript or possibly Vue.js.
Here's what I've attempted:
if(evt.to.getElementById("list2")){
console.log("IT HAS");
}
I want to avoid searching through the entire document and focus only on evt.to. Any ideas on how I can accomplish this without JQuery?