I am using this code to loop through each ".accessoryrow" and then select "dialog" + counter and ".see-details" + counter. So first time when loop goes by it selects dialog1 class and see-details1 class; second time dialog2, see-details2 and so on. I think I am not correctly adding counter to the selector. Please correct me. Thank you
CODE:
var counter = 1;
$(function () {
$(".accessoryrow").each(function() {
$(".dialog" + counter).dialog({
autoOpen: false,
show: "blind",
hide: "fade"
});
$(".see-details" + counter).click(function () {
$(".dialog" + counter).dialog("open");
return false;
});
counter++;
});
.see-detailsadded to the DOM after the page loads?