source: Dev/trunk/d3/examples/hello-world/select-enter-add.html @ 76

Last change on this file since 76 was 76, checked in by fpvanagthoven, 14 years ago

d3

File size: 610 bytes
Line 
1<!DOCTYPE html>
2<html>
3  <head>
4    <title>Test - select > enter > append</title>
5    <script type="text/javascript" src="../../d3.js"></script>
6  </head>
7  <body>
8    <span></span>
9    <span></span>
10    <script type="text/javascript">
11
12var s = d3.select("body")
13  .selectAll("span")
14    .data("The test passed, hooray!".split(/\b/));
15
16// Add missing <span>s.
17s.enter().append("span")
18  .append("b")
19    .text(function(d) { return d; });
20
21// Add missing <b>s.
22s.selectAll("b")
23    .data(function(d) { return [d]; })
24  .enter().append("b")
25    .text(function(d) { return d; });
26
27    </script>
28  </body>
29</html>
Note: See TracBrowser for help on using the repository browser.