📜  js 从 select 中提取选项 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:39.057000             🧑  作者: Mango

代码示例1
// @florinrelea
const selectElementId = 'example'
const htmlOptionsCollections = document.getElementById(selectElementId).options
const options = Array.from(htmlOptionsCollections).map(el=> el.textContent)
console.log(options)