point system virker ikke
Hvordan for jeg de forskellige billeder til at give "point" under den samme input?<script type="text/javascript">
var klikAntal = 0;
var billaAntal = 499999;
var billaAntal1 = 0;
var pandaAntal = 4999;
var pandaAntal1 = 0;
var ovnAntal = 49;
var ovnAntal1 = 0;
function keksKlik(){
document.getElementById('keksclicked').value = ++klikAntal;
Klik();
}
//OVN OPGRADERING
function ovnKlik(){
document.getElementById('clickedovn').value = ++ovnAntal1;
document.getElementById('keksclicked').value = ++ovnAntal;
Klik();
}
//PANDA OPGRADERING
function pandaKlik(){
document.getElementById('clickedpanda').value = ++pandaAntal1;
document.getElementById('keksclicked').value = ++pandaAntal;
Klik();
}
//BILLA OPGRADERING
function billaKlik(){
document.getElementById('clickedbilla').value = ++billaAntal1;
document.getElementById('keksclicked').value = ++billaAntal;
Klik();
}
function Klik(){
//OVN
if (document.getElementById('keksclicked').value+document.getElementById('clickedovn').value < 500) {
document.getElementById('ovnetekst').style.color="red"
}else{
document.getElementById('ovnetekst').style.color="green"
}
//PANDA
if (document.getElementById('keksclicked').value+document.getElementById('clickedpanda').value < 50000) {
document.getElementById('pandatekst').style.color="red"
}else{
document.getElementById('pandatekst').style.color="green"
}
//BILLA
if (document.getElementById('keksclicked').value+document.getElementById('clickedbilla').value < 500000000) {
document.getElementById('billatekst').style.color="red"
}else{
document.getElementById('billatekst').style.color="green"
}
}
</script>
<input style="cursor:default; font-family:monospace; font-size:20px;" id="keksclicked" size="13" onfocus="this.blur();" value="0">