When I drag and drop the green box into another col I get this error:
this.append is not a function
Why?
https://jsfiddle.net/gdxwks0t/1/
const cols = document.getElementsByClassName('col')
const item = document.querySelector('.item')
for (const col of cols) {
col.addEventListener("dragover", (e) => {
e.preventDefault()
})
col.addEventListener("drop", () => {
alert(this)
this.append(item)
})
}
<div class="col">
<div draggable="true" class="item"></div>
</div>
<div class="col"></div>
<div class="col"></div>