Simple onClick Event not working on Safari (MacOS/iOS)

TLKHH
Tourist
14 0 1

Hey!

I'm new to JavaScript but I took my time and implemented a simple "Info Button" to showcase the delivery time in my shop.

This is the code: 

$('.deliverytime-sec').click(function() {
  $(this).toggleClass("show");
  $('.showtext').toggleClass("showtext-active");
});

 

On Chrome (Desktop/Mobile) this works great without any problem. Though if I test it on Safari sometimes the button doesn't fire the event. Nothing happens.

I've googled quite a bit and tried to use "touchstart" but that didn't work and resulted in the button not working at all. 

I've also assigned the "a" tag to the element and gave it "cursor: pointer;"

0 Likes