This question seems easy but I just can’t get it right.
<ul id="myUL">
<li id="item1">
<select class="partDesc"><option>Front</option><option>Rear</option></select>
<input type="text" class="itemDesc">
<img src="images/myimg.jpg" class="itemImg" >
</li>
<li id="item2">
<select class="partDesc"><option>Front</option><option>Rear</option></select>
<input type="text" class="itemDesc">
<img src="images/myimg.jpg" class="itemImg" >
</li>
</ul>
These <li> items are dynamically added using jquery.
I want to traverse these <li> items and get all the inputs, including selected value from partDesc, text from itemDes and src from itemImg.
Here is where I stuck:
$("#myUL li").each(function() {<br>
var partDesc = $(this).??;<br>
var itemDesc = $(this).??;<br>
var itemImg = $(this).??;<br>
});
Thank you for reading.
following script should help you. here is the
demo