I have this code which I need to set a unique title:
var tmpImg = '<img src="/admin/icons/cross.png" title="' + title + '" />';
$(this).find("tr td input").each(function(){
title = $(this).attr("value");
$(this).hide().before(tmpImg);
});
What I want to happen, is that each time the each iterates over the <input>, it updates the title value in the tmpImg string. I know I could separate the img HTML like below, although I think this would get messy when I need to reuse the image later down the script.
var tmpImg = '<img src="/admin/icons/cross.png" title="';
$(this).find("tr td input").each(function(){
title = $(this).attr("value");
$(this).hide().before(tmpImg + title + '" />');
});