I'm trying to append some text below several charts(like a caption) Using D3JS. In order to so I tried to appended a "g" element and inside it a "text" element, and then tried to access the array of "text" elements via jQuery to set the html using this route:

```
$("#pie"+ i).find("text:nth-child(4)").eq(1) 

```

, which points to the "text" below each donut chart, and using a for loop I tried to set certain text stored in a array of strings, but I'm not able to iterate through the array of "text" elements. Can you tell me what am I going wrong? 

This is what I tried to do but didn't work:

```
   g.append("text")
        .attr("transform", "translate(0,60) scale(.7)")
        .attr("class","caption")

    var captionArr = ["chart 1","chart 2","chart 3","chart 4","chart 5","chart 6","chart 7","chart 8"]    

    for(i = 1; i <= $(".caption").lenght; i++){
     ($("#pie"+ i).find("text:nth-child(4)").eq(1)).html(captionArr[i])
    }   

```

Here's my Fiddle:

<http://jsfiddle.net/jcrr1985/q2uxs8r1/6/>

thanks for the help, I appreciate so much.