JQuery create new select option

前端 未结 6 1379
遥遥无期
遥遥无期 2020-12-29 19:46

I have the below functions in regular JavaScript creating select options. Is there a way I can do this with jQuery without having to use the form object? Perhaps storing the

6条回答
  •  清歌不尽
    2020-12-29 20:09

    A really simple way to do this...

    // create the option
    var opt = $("

    This could be done in lots of ways, even in a single line if really you want to.

提交回复
热议问题