javascript - add a DOM object to array in jquery -
i have following code
a_ajouter = $('.question'); hidden_div.push(a_ajouter); console.log(hidden_div);
well, dom object should added div, however, console shows 'jquery.fn.init1' last element. no idea is.
here the page itself. if not clear enought (click on arrow start event)
you trying add jquery array inside normal array, want add jquery object.
a_ajouter = $('.question').eq(0); //first element hidden_div.push(a_ajouter); console.log(hidden_div);
or dom object itself.
a_ajouter = $('.question').eq(0); //first element hidden_div.push(a_ajouter[0]); //html element without jquery wrapper console.log(hidden_div);
Comments
Post a Comment