# How do I get the mousePressed function to change to different words each time on p5.js?

**URL:** <https://discourse.processing.org/t/how-do-i-get-the-mousepressed-function-to-change-to-different-words-each-time-on-p5-js/24134>\
**Category:** Coding Questions\
**Created:** [September 26, 2020, 7:49am UTC](https://discourse.processing.org/t/how-do-i-get-the-mousepressed-function-to-change-to-different-words-each-time-on-p5-js/24134 "2020-09-26T07:49:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)\
**Post date:** [September 26, 2020, 8:19am UTC](https://discourse.processing.org/t/how-do-i-get-the-mousepressed-function-to-change-to-different-words-each-time-on-p5-js/24134/2 "2020-09-26T08:19:52Z")

</div>

Hello @sam101

First, a friendly tip: format your code by highlighting it and press the code button (it looks like `</>` ) in the editor. Easy to read code will most certainly attract more people to help you out. 😊 (There’s more [great tips here](https://discourse.processing.org/t/guidelines-asking-questions/2147).)

To answer your original first question (top post has been edited):

> This worked at the beginning, but then I added the keyPressed function and somehow the word “Monday” it stoped showing up?

Have you made sure the code is executing alright without throwing errors? You could look for problems using the [developer console in your browser](https://balsamiq.com/support/faqs/browserconsole/).

---

_[View the full topic](https://discourse.processing.org/t/how-do-i-get-the-mousepressed-function-to-change-to-different-words-each-time-on-p5-js/24134)._
