I have tried several ways to loop through a set of 4 li elements, each with a class of "item_n" where in is an integer 1-4. I need to increment by 1 with each click. I have come close, but it ended up getting worse. Here is my semi-working code:
$('input.compare').change(function(){
var me = $(this).attr("refid");
$('li.item_1').append('<img src="images/submenu/' + me + '.png" alt="compare1" height="28" width="28" />');
});
I need to loop through the li.item_1 selector like $('li.item_"+i"') with each click until four is reached.
Thanks in advance.