Click event on button is sending an icon as the target?

Use event.currentTarget which is always the object listening for the event; event.target is the actual target that received the event which is not what you want in this case since it could be the icon.

With event.currentTarget if the user clicks on the icon, it’ll bubble the event up to the object listener which is the button in your case. If the user clicks the button it’ll still work because again the object listener is your button.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)