Question: how to retain selected value of dropdown in javascript?
Answer: // You can put it in LocalStorage.
var.
lmnt = document.getElementById("elementId"),
valSelected = lmnt.options[lmnt.selectedIndex].value;
localStorage.setItem("val", valSelected);
// To obtain this value, you can do the following.
var.
valStored = localStorage.getItem("val");