I am using JQuery .each() on a list and am wondering how to retrieve the text from an input field within the list item, the code looks like:
<ul id="foo">
<li id="1">
<input type="text" />
</li>
<li id="2">
<input type="text" />
</li>
</ul>
I then need to get the id and text to send to an AJAX call
$(#foo li).each( function() {
id = this.id; // Works fine
mytext = ???; // The bit i'm stuck with
...
});
There is only one input control per list item.