I have researched and have been trying to figure this problem out for a few days. Haven't found anything that really helps other than make it more complex. I'm trying to change the variable health, based on what level their character is which they can choose from a drop down menu. I can't figure out how to do the javascript function and call the answer that they have in the drop down menu. Any help will be greatly appreciated! Here's my code:
<!DOCTYPE html>
<html>
<head>League Of Legends Damage Calculator<title>
</title>
</head>
<body>
<p>
<script>
var health;
var ad;
var adspeed;
var movespeed;
var healthregen;
var armor;
var apresist;
</script>
</p>
<p>
Aatrox Base Stats: <br>
<img src="http://ddragon.leagueoflegends.com/cdn/4.5.4/img/champion/Aatrox.png" width="150" height="150"> <br>
<script>
document.write("Health - " + health);
</script>
Basic Attack Damage - 55
Basic Attack Speed - .651
Movement Speed - 345
Health Regen - 5.75
Armor - 18
Magic Resist - 40
</p>
<p>
<form name="form1">
<select id="opts" onchange="showForm()">
<option value="0">Level Stats - 1</option>
<option value="1">Level Stats - 2</option>
<option value="2">Level Stats - 3</option>
<option value="3">Level Stats - 4</option>
<option value="4">Level Stats - 5</option>
<option value="5">Level Stats - 6</option>
<option value="6">Level Stats - 7</option>
<option value="7">Level Stats - 8</option>
<option value="8">Level Stats - 9</option>
<option value="9">Level Stats - 10</option>
<option value="10">Level Stats - 11</option>
<option value="11">Level Stats - 12</option>
<option value="12">Level Stats - 13</option>
<option value="13">Level Stats - 14</option>
<option value="14">Level Stats - 15</option>
<option value="15">Level Stats - 16</option>
<option value="16">Level Stats - 17</option>
<option value="17">Level Stats - 18</option>
</select>
</form>
<script>
function Stats(form1) {
var decidelevel;
decidelevel = document.getElementById('opts');
if(decidelevel = "0"){
health = 395;
};
if(decidelevel = "1") {
health = 395 + (85 * decidelevel);
};
// etc
};
</script>
</p>
</body>
</html>