Fix HTML structure for event listener