0
I’m using the command
$("div").delegate( ".btnAcessoAtividade", "click", function()
{
var id = $(this).attr('id');
window.localStorage.setItem("id",id);
console.log( $(this) );
$('.reunioes').prepend( window.localStorage.getItem('id') );});
because I want to get the id of the following structure:
$(".reunioes").append(
"<div class='btnAcessoAtividade' id ='*"+response.data[i].id+"'>"
+"<span class='nome'> "+response.data[i].deal_title+"</span>"
+"<span class='hora'>"+response.data[i].due_time+"</span>"
+"</div>"
);
only that for some reason, it’s bringing the "id" 3 times...:
init [div#*14174.btnAccessiveness, context: div#*14174.btnAccessActivity] init [div#*14174.btnAccessiveness, context: div#*14174.btnAccessiveness] init [div#*14174.btnAccessiveness, context: div#*14174.btnAccessActivity]
why does it happen? what am I doing wrong?
Because you have three elements with the btnAccessAtivity class?
– Leandro Angelo
hi, Leandro, did not understand its placement...I have the main class , that is the "meetings", within it, are several classes(elements) "btnAccessAtivity" as if they were "lines"...each line, with its id...but the way it appears and that I posted,who repeats, are the ids ids
– Horacio J.
It is difficult to specify your error exactly without the rest of the code and HTML. You can get an idea of the error but without precision. If you have a
for
, you are probably applying the same ID to several buttons. Or you have more than one class.reunioes
(in case, 3).– José