- Code: Select all
Class="County"
- Code: Select all
onchange="ShowSuburb();"
- Code: Select all
function ShowSuburbs()
{
var county = document.getElementById("County").value;
alert(county);
}
but all I get is an empty alert. Can anyone help with this?
![]() | It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!) |

|
|
|
|
Class="County"onchange="ShowSuburb();"function ShowSuburbs()
{
var county = document.getElementById("County").value;
alert(county);
}
<script>
function ShowSuburbs()
{
var county = document.getElementById("County");
alert(county.selectedIndex);
var countyValue = county.options[county.selectedIndex].value;
alert(countyValue);
}
</script>
<select name="County" id="County" onChange="ShowSuburbs()">
<option value="red">red</option>
<option value="blue">blue</option>
<option value="green">green</option>
</select>var countyValue = county.options[county.selectedIndex].value;
var countyValue = county.value;

Users browsing this forum: No registered users and 4 guests