convert onclick attributes to EventListeners