Converting function to event listener

Ah, that’s interesting , thanks. Looking at what I have though I’m not sure what I have attached the listener to.