I want to add ID to each element of class .content, and I want each ID to have integer increase by 1. Example:
.content
You can use the index parameter of the .each function callback instead of your own counter:
$(".content").each(function(i) { $(this).prop('id', 'content_' + (i+1)); });