The following code creates and removes a button with an onclick listener.
Does the onclick listener persist after the element is removed from the DOM?
let el = document.createElement('button')
el.innerHTML = "Test Button"
el.onclick = function(){
alert('A Click Happened')
}
document.body.appendChild(el)
document.body.removeChild(el)
Bonus: Is the same true for el.addEventListener('click',() => { alert('clicked') })
?