Last active
November 25, 2017 16:10
-
-
Save idettman/a10186abcbe697374781 to your computer and use it in GitHub Desktop.
Remove All Select Options (Fast)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {HtmlSelectElement} selectElement | |
*/ | |
function removeAllSelectOptions(selectElement) { | |
selectElement.parentNode.replaceChild(selectElement.cloneNode(false), selectElement); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment