I have the following code:
var tempIdx = document.getElementById('cityBuild').selectedIndex;
var tempBuilding = document.getElementById('cityBuild').options[tempIdx].value;
// Do stuff with tempBuilding
I spent some time trying to do it in jQuery under the assumption it'd be easier, it wasn't. I tried what was given at this site but is never returned any of the values. Am I doing something wrong or is this something that jQuery simply doesn't do?
The item is a select box (single selection only) and I want to get the value from it.