Programmatically create select list

后端 未结 8 2253
不知归路
不知归路 2020-11-29 02:48

Does anyone know of a technique to programmatically create an HTML select list including options using JQuery?

8条回答
  •  死守一世寂寞
    2020-11-29 03:14

    var arr = [
      {val : 1, text: 'One'},
      {val : 2, text: 'Two'},
      {val : 3, text: 'Three'}
    ];
    
    var sel = $('
                            
        
    提交评论

提交回复
热议问题