If I’m appending multiple items in javascript like this:
data.context = $('<button class="btn btn-primary"/>').text('Upload')
.appendTo('#fileTableId')
.click(function () {
$(this).replaceWith($('<p id="aa"/>').text('Uploading...'));
data.submit();
});
How can I give each that is being replacedWith p tag a unique id if for example x++ is what I want to set it to.
var x = 0
'<p id = "'x'" />
x++;
You can use
.propto set theidproperty: