标签:function,menu,list,month,路由,使用,Django,response,select From: https://www.cnblogs.com/pqhuang/p/18089018$('select[name=select_month]').each(function (index) { month_list = response["time_dict"][response["year"]] select_menu = $(this) month_list.forEach(function (month) { if (month == response["month"]) { select_menu.append(`<option selected>${month}</option>`) } else { select_menu.append(`<option>${month}</option>`) } }) })