Files

24 lines
363 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Select a Group of Elements with D3
---
## Select a Group of Elements with D3
2018-10-17 09:40:23 +05:30
### Hint
2018-10-12 15:37:13 -04:00
2018-10-17 09:40:23 +05:30
Use the ``` selectAll() ``` method and chain it with the ``` text() ``` method.
2018-10-12 15:37:13 -04:00
2018-10-17 09:40:23 +05:30
### Solution
```html
<body>
<ul>
<li>Example</li>
<li>Example</li>
<li>Example</li>
</ul>
<script>
d3.selectAll("li").text("list item")
</script>
</body>
```