Populate dropdown select with array using jQuery

后端 未结 8 1882
花落未央
花落未央 2020-11-29 08:07

I am trying to populate a dropdown select with an array using jQuery.

Here is my code:

        // Add the list of numbers to the drop down here
              


        
8条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 08:39

    var qty = 5;
    var option = '';
    for (var i=1;i <= qty;i++){
       option += '';
    }
    $('#items').append(option);
    

提交回复
热议问题