A better approach would be to do `element.onclick = ` before appending it. This approach uses hard-coded array indexes and is therefore more likely to break.