I want to add ID to each element of class .content, and I want each ID to have integer increase by 1. Example:
.content
Use this operator
var number = 1; $(".content").each(function() { $('.content').attr('id', 'content_' + number); number++; });
or
var length = $(".content").length; for(i=1;i