data insertion in 2D array in jquery -


i want insert data in array through jquery below:

means @ first time insert values on first position , second time insert values on second postion (i.e not insert values @ time on both positions)

    var custarr = new array();     custarr.push(["structure", "select parent"]);     custarr.push(["a", ""]);     custarr.push(["b", ""]);      var sel = $('<select>').appendto('body');      (var = 0; < custarr.length; i++)      {        custarr.push("", sel.append($("<option>").attr('value', "some values");     } 

expected result is:

custarr.push(["structure", sel.append($("<option>").attr('value', "some values")]); 

i cannot insert them both problem firstly in first loop. can insert structure values , in second loop need insert dropdown in front of structure values.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -