nick34992
2/24/2017 - 1:07 AM

D3: d3.select, style: Select DOM Element and Change Style Background Color

D3: d3.select, style: Select DOM Element and Change Style Background Color

<!DOCTYPE html>
<html lang="en">
<head>
    <title>d3.select | style</title>
    <meta name="description"
          content="Use d3.select to set background color of list item line to
                   darkkhaki">
</head>
<body>
    <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
    <ul>
        <li>first</li>
        <li>second</li>
        <li>third</li>
        <li>fourth</li>
    </ul>
    <script>
        d3.select('li').style('background-color', 'darkkhaki')
    </script>
</body>
</html>