ik heb dus een foutmelding in mijn script
regel 24
teken 10
fout 'document.getElementById(...)' is null or not an object
code 0
regel 24
teken 10
fout 'document.getElementById(...)' is null or not an object
code 0
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<center>
<h1>Helze's summoning calculators</h1>
<p> </p>
</center>
<b>
<script language="JavaScript" type="text/javascript">
function ber() {
var A = document.getElementById(gold).value;
var B = document.getElementById(green).value;
var C = document.getElementById(crimson).value;
var D = document.getElementById(blue).value;
var E = document.getElementById(gold_menu).value;
var F = document.getElementById(green_menu).value;
var G = document.getElementById(crimson_menu).value;
var H = document.getElementById(blue_menu).value;
var I = document.getElementById(totaal).value;
document.getElementById(totaal).innerHTML =(( Number(A) * Number(E) ) + ( Number(B) * Number(F) ) + ( Number(C) * Number(G) ) + ( Number(D) * Number(H) ));
}
</script>
</b>
<center>
I use <input id="gold" name="gold" value="" size="4"> golden charms and I
make <select id="gold_menu" size="1" name="gold">
<option value="4,8">spirit wolf</option>
<option value="9,3">Dreadfowl</option>
</select><br>
I use <input id="green" name="green" value="" size="4"> green charms and I
make <select id="green_menu" size="1" name="green">
<option value="31,2">Desert wyrm</option>
<option value="49,8">Compost mound</option>
</select><br>
I use <input id="crimson" name="crimson" value="" size="4"> crimson charms and I
make <select id="crimson_menu" size="1" name="crimson">
<option value="83,2">Spirit scorpion</option>
<option value="96,8">Spirit Tz-Kih</option>
</select><br>
I use <input id="blue" name="blue" value="" size="4"> blue charms and I make
<select id="blue_menu" size="1" name="blue">
<option value="202,4">Albino rat</option>
<option value="220">Spirit kalphite</option>
</select><p>My current xp is<input id="totaal" name="current xp" size="4"></p>
<input type="submit" value="bereken" onclick="ber()"><p><br>
totaal xp:<b id="totaal"></b><br>
</p>
</center>
</body>
</html>
Laatst bewerkt: