Iterate through <select> options

前端 未结 8 1285
不思量自难忘°
不思量自难忘° 2020-11-28 03:00

I have a

提交评论

  • 2020-11-28 03:32

    If you don't want Jquery (and can use ES6)

    for (const option of document.getElementById('mySelect')) {
      console.log(option);
    }
    
    0 讨论(0)
  • 提交回复
    热议问题