JQuery create new select option

前端 未结 6 1374
遥遥无期
遥遥无期 2020-12-29 19:46

I have the below functions in regular JavaScript creating select options. Is there a way I can do this with jQuery without having to use the form object? Perhaps storing the

6条回答
  •  心在旅途
    2020-12-29 19:51

    If you need to make single element you can use this construction:

    $('

    But if you need to print many elements you can use this construction:

    function printOptions(arr){
        jQuery.each(arr, function(){
            $('

提交回复
热议问题