Create

前端 未结 1 922
慢半拍i
慢半拍i 2021-01-21 11:53

I\'d like to build s on the fly in a box based on an AJAX response; i.e. if the responseText is 3, I\'d like to build 3 options:

1条回答
  •  无人及你
    2021-01-21 12:27

    You can do:

    var routeSelect = $("#PAG_POSITION").get(0);
    
    routeSelect.html(''); //clear-out options
    
    if (isNaN(opts) || opts == 0) {
        //Handles case where your response is invalid or zero
        routeSelect.append($('

    Hope this helps.

    0 讨论(0)
提交回复
热议问题