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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -