# Solution: Change Text With Click Events | D3

**URL:** <https://forum.freecodecamp.org/t/solution-change-text-with-click-events-d3/449614>\
**Category:** freeCodeCamp Contributors\
**Tags:** contributing\
**Created:** [March 4, 2021, 7:13pm UTC](https://forum.freecodecamp.org/t/solution-change-text-with-click-events-d3/449614 "2021-03-04T19:13:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![justinyates887](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/justinyates887/32/208346_2.png) [@justinyates887](https://forum.freecodecamp.org/u/justinyates887)\
**Post date:** [March 4, 2021, 7:13pm UTC](https://forum.freecodecamp.org/t/solution-change-text-with-click-events-d3/449614/1 "2021-03-04T19:13:09Z")

</div>

**What is your hint or solution suggestion?**  
Nest this inside of .onclick = function()

`document.getElementsByClassName('message')[0].textContent="Here is the message";`

**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:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [September 3, 2021, 7:13am UTC](https://forum.freecodecamp.org/t/solution-change-text-with-click-events-d3/449614/2 "2021-09-03T07:13:46Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
