var custom = {{ custom_list | safe }}
var obj = JSON.parse(custom);
$('#compclass').html("<option>"+obj[0].fields.name+"</option>")
html是替换html当中内容,append是加入
for(var i=0;i<obj.length;i++){
$('#compclass').append("<option>"+obj[i].fields.name+"</option>")
}














相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-11-01
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
  • 2021-07-22
  • 2021-11-03
  • 2021-05-02
相关资源
相似解决方案