Programmatically create select list

后端 未结 8 2263
不知归路
不知归路 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:22

    Here's a variation - based on previous answers in this thread - where all but the select-input options can be specified via an input JSON object:

    Would be interesting to see if the options array can somehow be specified in that JSON input?

        var fruitListProfile = {
            id : someKey,
            class : 'fruit_list',
            style : 'margin-right: 20px; '
        };
    
        var selectInput = $('
                            
        
    提交评论

提交回复
热议问题