Answers for "js extract options from select"

1

js extract options from select

// @florinrelea
const selectElementId = 'example'
const htmlOptionsCollections = document.getElementById(selectElementId).options
const options = Array.from(htmlOptionsCollections).map(el=> el.textContent)
console.log(options)
Posted by: Guest on February-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language