I am trying to use jQuery to get the text of child elements.

I must be doing something wrong, been working on this for 2 days now.

If someone has a moment to take a look, I would be very grateful!

**CODE:**

```
function generateRemoveSectionDropDown() {
    var dropDown = document.getElementById('RemoveSectionId');
    var agendaDiv = $("[name='agenda-nestable']");
    var agendaSections = $(agendaDiv).find("ol#agenda-root>li");
    for (var i = 0; i < agendaSections.length; i++) {
        var optValue = null;
        var optText = null;
        var section = agendaSections[i];
        var sectionChildren = $(agendaSections[i]).children();
        for (var j = 0; j < sectionChildren.length; j++) {
            alert('The text from child is: ' + sectionChildren[j].text);
            optValue = j;
            optText = sectionChildren[j].text;
        }

        var opt = document.createElement('option');
        opt.value = optValue;
        opt.innerText = optText;
        dropDown.appendChild(opt);
    }
}

```

**PLUNK:** <http://plnkr.co/edit/jLi9epblNAtMbzezcRSY?p=preview> (if you click the "Run Method", my code will run)

**Note:** Updated code.I had been hacking around with it, putting it back in a good state.