$(document).ready(function() { var counter = 0; $('form > .ticket_elementDiv').each(function(){ $(this).removeClass('ticket_elementDiv').addClass('input-group'); $(this).find('label').replaceWith(''+$(this).find('label').text()+''); $(this).find('input').attr('aria-describedby','addon'+counter); counter = counter+1; }); $('.attachment_header').each(function(){ $(this).replaceWith('