How to bind array values in dropdown using jquery -
i having array
var servicearray= new array("living room","dining room","bedroom(s)","family room","kitchen","den","hallway(s)","ste(s)","bathroom","landing(s)");
i want bind array values in alternative of next select tag using jquery..
<select class="services_list"></select>
try this:
demo on fiddle html:<select class="services_list"></select>
javascript: var servicearray= new array("living room","dining room","bedroom(s)","family room","kitchen","den","hallway(s)","ste(s)","bathroom","landing(s)"); (i = 0; < servicearray.length; i++) { var info = '<option>' + servicearray[i] + '</option>' $('select').append(data); }
jquery
No comments:
Post a Comment