MCPcopy Create free account
hub / github.com/SKVNDR/FastDork / selectOptionByValue

Function selectOptionByValue

Script/FastDork.js:759–773  ·  view source on GitHub ↗
(selectElement, valueToSelect)

Source from the content-addressed store, hash-verified

757 console.log("[loadAndPopulateEngines] Finished populating engines.");
758 }
759 function selectOptionByValue(selectElement, valueToSelect) {
760 if (
761 !selectElement ||
762 typeof valueToSelect === "undefined" ||
763 valueToSelect === null
764 )
765 return false;
766 for (let i = 0; i < selectElement.options.length; i++) {
767 if (selectElement.options[i].value === valueToSelect) {
768 selectElement.selectedIndex = i;
769 return true;
770 }
771 }
772 return false;
773 }
774 function getFirstAvailableImportListKey() {
775 const options = Array.from(UI.listTab2?.options || []).filter(
776 (option) => option && !option.disabled && option.value && option.value !== "0"

Callers 5

loadAndPopulateListsFunction · 0.85
createDorkListFunction · 0.85
loadSavedOptionsFunction · 0.85
initializeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected