jquery - Loading options in Dropdown (using delegate) -


hello everyone

in code, there 1 drop down list. want add options it. have used following code. adding fields via jquery. after that, can not select option drop down. think because of click event..

var myoptions = {                         'india' : 'india',                         'sri lanka' : 'sri lanka',                         'uae' : 'uae',                         'qatar' : 'qatar'                     };     var drop_down = jquery("[name='ab-custom-field-1252']");     jquery("body").on('click',drop_down,function()     {         var myselect = jquery("[name='ab-custom-field-1252']");         myselect.html('');         jquery.each(myoptions, function(val, text) {         myselect.append(                 jquery('<option></option>').val(val).html(text)             );             });     }); 

can me? highly appreciated.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -