Today I have been trying to write a simple script. With selecting a certain "Option" via the Select Box, I'm trying to make the second Select Box correspond to the first. Sounds simple enough, though I'm finding some difficulties.
Here is the basic:
Code:
<html>
<head>
<title>Index</title>
<meta name="robots" content="noindex,nofollow" />
<style type="text/css">
</style>
<head>
<body>
<script type="text/javascript">
fuction country()
{
var country;
var a=document.getElementById("us");
var b=document.getElementById("can");
var c=document.getElementById("misc");
if (country==a) document.write("<select><option>New
Hampshire</option><option>Alabama</option<option>Alaska</option></select>");
else if (country==b) document.write("<select><option>New
Brunswick</option><option>Alberta</option<option>Quebec</option></select>");
else (country==c) document.write("<select><option>England</option><option>France</option<option>China</option></select>");
}
</script>
<select>
<option id="us" onselect="country()">United States</option>
<option id="can" onselect="country()">Canada</option>
<option id="misc" onselect="country()">Other</option>
</select>
<select>
</select>
</body>
</html>
Many thanks in advance for any suggestions correcting my errors.