Jquery getJSON populate select menu question

前端 未结 5 1535
鱼传尺愫
鱼传尺愫 2020-11-29 03:28

I am populating a select menu with getJSON. I am wondering if there\'s a way that I can use jQuery\'s .each function to bring in these values?

Surely there must be

5条回答
  •  伪装坚强ぢ
    2020-11-29 04:17

    This should work:

       $.getJSON('selectMenus.php', function(data){
            $.each(data, function(index,item) {
               $("select.month").append(""); 
        });
        });
    

提交回复
热议问题