# mouseClick() function doesn't work on iPhone (p5.js)

**URL:** <https://discourse.processing.org/t/mouseclick-function-doesnt-work-on-iphone-p5-js/22866>\
**Category:** p5.js\
**Created:** [July 27, 2020, 7:33pm UTC](https://discourse.processing.org/t/mouseclick-function-doesnt-work-on-iphone-p5-js/22866 "2020-07-27T19:33:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![papaboo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/papaboo/32/11236_2.png) [@papaboo](https://discourse.processing.org/u/papaboo)\
**Post date:** [July 27, 2020, 7:33pm UTC](https://discourse.processing.org/t/mouseclick-function-doesnt-work-on-iphone-p5-js/22866/1 "2020-07-27T19:33:55Z")

</div>

I’ve made a simple application. It works on all major platforms (macOS, Windows, Android etc) but it doesn’t do anything on iPhone Safari. It just draws things on the screen but nothing interactive; nothing written in mouseClick() function seems to work.

I was so expectant that I was going to make a mobile application with Ionic framework with this application. Is there any solution to this?

---

<div class="post-metadata">

**Author:** ![slow\_izzm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/slow_izzm/32/5637_2.png) [@slow\_izzm](https://discourse.processing.org/u/slow_izzm)\
**Post date:** [July 27, 2020, 10:10pm UTC](https://discourse.processing.org/t/mouseclick-function-doesnt-work-on-iphone-p5-js/22866/2 "2020-07-27T22:10:43Z")

</div>

Did you try `touchStarted()`?

[https://p5js.org/reference/#/p5.Element/touchStarted](https://p5js.org/reference/#/p5.Element/touchStarted)

---

<div class="post-metadata">

**Author:** ![jeffphi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeffphi/32/20294_2.png) [@jeffphi](https://discourse.processing.org/u/jeffphi)\
**Post date:** [January 4, 2025, 9:43pm UTC](https://discourse.processing.org/t/mouseclick-function-doesnt-work-on-iphone-p5-js/22866/3 "2025-01-04T21:43:47Z")

</div>

FWIW, I confirmed that just adding the `touchEnded()` function, which then just called my existing  
`mouseClicked()` function, did the trick on iOS Safari.
