I'm currently working on a project where I need to create a website that multiplies three numbers selected from dropdown menus together. However, when I attempt to perform the calculation, I only get the result "1" displayed. I've spent several hours searching for solutions but haven't been able to find any changes that resolve the issue. Any help or suggestions would be greatly appreciated. Thank you!
<!doctype html>
<html lang="en>
<head>
<title>
Test Project
</title>
<link rel="stylesheet" href="main.css" />
</head>
<meta charset="utf-8" /> </meta>
<body>
<div id="div_1" align="center">
<header id="top_header">
<h1>Test Project</h1>
</header>
</div>
<div align="center">
<select id="Section1">
<option value="1"> 1</option>
<option value="2"> 2</option>
<option value="3"> 3</option>
<option value="4"> 4</option>
<option value="5"> 5</option>
<option value="6"> 6</option>
<option value="7"> 7</option>
<option value="8"> 8</option>
<option value="9"> 9</option>
<option value="10"> 10</option>
</select>
<select id="Section2">
<option value="1"> 1</option>
<option value="2"> 2</option>
<option value="3"> 3</option>
<option value="4"> 4</option>
<option value="5"> 5</option>
<option value="6"> 6</option>
<option value="7"> 7</option>
<option value="8"> 8</option>
<option value="9"> 9</option>
<option value="10"> 10</option>
</select>
<select id="Section3">
<option value="1"> 1</option>
<option value="2"> 2</option>
<option value="3"> 3</option>
<option value="4"> 4</option>
<option value="5"> 5</option>
<option value="6"> 6</option>
<option value="7"> 7</option>
<option value="8"> 8</option>
<option value="9"> 9</option>
<option value="10"> 10</option>
</select>
<script>
function myFunction() {
var x = document.getElementById("Section1").selectedIndex;
var y = document.getElementById("Section2").selectedIndex;
var z = document.getElementById("Section3").selectedIndex;
alert(document.getElementsByTagName("Option")[x * y * z].value);
}
</script>
<button onclick="myFunction()">Calculate</button>
</body>
</html>