Changed jQuery's click to .on for alert management