Reputation: 15855
I am using jquery mobile latest version. I have a select field that actually look like this:
<select id="make">
</select>
I want to dynamically added option on it.So I use this code :
var makeArr = new Array(1, 2, 3, 4, 5);
var parent = $('#make');
$.each(makeArr, function(i, item){
parent.append('<option value="' + item + '">' + item + '</option>');
});
I have also use parent.append('<option value="' + item + '">' + item + '</option>').trigger('create');
but nothing change.
I have added <li>
under <ul>
by this way.But this is not working here.
Upvotes: 0
Views: 51
Reputation: 2222
try
$("#make").selectmenu('refresh', true);
after inserting dynamic content.
Upvotes: 1