I want to access the text content inside the div and show it in an alert (), but for this I have a list of users selected from the database, I did a little trick to add a counter in each div class that contains the user name, see example:
and so on. But when I put the alert (), it displays all the users at once within the alert, even though I create a div for each one. Someone gives a help. my Code:
$('.innerbox_contatos_search').click(function(){ $('.info-part a').addClass('ativo'); var i = 1; $(".ativo").each( function() { $(this).attr("class", "ativo-"+i); alert($('a.ativo-'+i).text()); i++; }); });