How can I store the JS function to cache, so the disabled dropdown selections will be saved when refreshing the page. Refreshing the page now the disabled dropdown menu’s are gone.
my dropdown:
<label >Master</label>
<select onchange="onChangeYesNo(this)">
<option value="Master1">Master 1</option>
<option value="Master2">Master 2</option>
</select>
<label >Numbers</label>
<select id="numbers">
<option value="1">Number 1</option>
<option value="2">Number 2</option>
<option value="3">Number 3</option>
<option value="4">Number 4</option>
<option value="5">Number 5</option>
</select>
<label >Letters</label>
<select id="letters">
<option value="A">Letter A</option>
<option value="B">Letter B</option>
<option value="C">Letter C</option>
<option value="D">Letter D</option>
<option value="E">Letter E</option>
</select>
js function code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
function onChangeYesNo(option) {
if(option.value == "Master1"){
document.getElementById("numbers").disabled = true;
document.getElementById("letters").disabled = false;
}
if(option.value == "Master2"){
document.getElementById("numbers").disabled = false;
document.getElementById("letters").disabled = true;
}
}
</script>
Thanks in advance.