Selections, Drill 4

Write the function selectCircles to return a d3 selection of all the circles that are children of the group-2 element.

    <svg id="svg">
      <g id="group-1">
        <circle cx="100" cy="50" r="20" fill="red"></circle>
        <circle cx="130" cy="50" r="20" fill="green"></circle>
        <circle cx="160" cy="50" r="20" fill="blue"></circle>
      <g id="group-2">
        <circle cx="100" cy="90" r="20" fill="cyan"></circle>
        <circle cx="130" cy="90" r="20" fill="magenta"></circle>
        <circle cx="160" cy="90" r="20" fill="yellow"></circle>
    var sel = selectCircles(); // write this function

Try it

SVG Output