# Change text with click event

**URL:** <https://forum.freecodecamp.org/t/change-text-with-click-event/422737>\
**Category:** freeCodeCamp Contributors\
**Tags:** contributing\
**Created:** [September 25, 2020, 10:43pm UTC](https://forum.freecodecamp.org/t/change-text-with-click-event/422737 "2020-09-25T22:43:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alaby258](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/alaby258/32/148248_2.png) [@alaby258](https://forum.freecodecamp.org/u/alaby258)\
**Post date:** [September 25, 2020, 10:43pm UTC](https://forum.freecodecamp.org/t/change-text-with-click-event/422737/1 "2020-09-25T22:43:00Z")

</div>

**What is your hint or solution suggestion?**

there is a mistake with the HTML.Try using document.getElementsByClassName(“message”)=“here is the new message”;  
instead of document.getElementsByClassName(“message-box”)=“here is the new message”; as indicated in the HTML

**Challenge:** Change Text with click Events

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/data-visualization/json-apis-and-ajax/change-text-with-click-events)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![Naomi](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/naomi/32/422181_2.png) [@Naomi](https://forum.freecodecamp.org/u/Naomi)\
**Post date:** [September 25, 2020, 10:56pm UTC](https://forum.freecodecamp.org/t/change-text-with-click-event/422737/2 "2020-09-25T22:56:38Z")

</div>

Hello~!

I am not quite sure what mistake you are seeing. The HTML has the following value:

```auto
<p class="message box">
  The message will go here
</p>

```

This element has two classes, “message” and “box”.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 6:32pm UTC](https://forum.freecodecamp.org/t/change-text-with-click-event/422737/3 "2021-06-01T18:32:19Z")

</div>


