Why doesn’t my javascript click event work on iOS/iPhone?

Pat Kavanagh

The overwhelming majority of browsers out there support event delegation for the click event, however, iOS does not. But, there is a way around this lack of support. Event delegation will work if the target of the event is a link or an input field.

So if you find yourself troubleshooting javascript event handlers on iOS, changing your <div>, <li> or any other element to an <a> tag will return better results.

Original Source

Last updated by on .

What Are Your Thoughts?

Your email address will not be published. Required fields are marked *