# freeCodeCamp Challenge Guide: Select a Group of Elements with D3

**URL:** <https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-select-a-group-of-elements-with-d3/301490>\
**Category:** freeCodeCamp Contributors\
**Tags:** guide\
**Created:** [August 3, 2019, 1:07pm UTC](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-select-a-group-of-elements-with-d3/301490 "2019-08-03T13:07:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![camperbot](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camperbot/32/18364_2.png) [@camperbot](https://forum.freecodecamp.org/u/camperbot)\
**Post date:** [August 3, 2019, 1:07pm UTC](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-select-a-group-of-elements-with-d3/301490/1 "2019-08-03T13:07:38Z")

</div>

# [Select a Group of Elements with D3](https://www.freecodecamp.org/learn/data-visualization/data-visualization-with-d3/select-a-group-of-elements-with-d3)

* * *

## Hints

### Hint 1

Use the `selectAll()` method and chain it with the `text()` method.

* * *

## Solutions

> **Solution 1 (Click to Show/Hide)**
>
> ```html
> <body>
> <ul>
> <li>Example</li>
> <li>Example</li>
> <li>Example</li>
> </ul>
> <script>
> d3.selectAll("li").text("list item")
> </script>
> </body>
> 
> ```

---

<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:** [January 8, 2025, 3:58pm UTC](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-select-a-group-of-elements-with-d3/301490/2 "2025-01-08T15:58:11Z")

</div>

Closed on January 8, 2025, 3:58pm UTC


