I am making a personality quiz where your result will be based on how many points you get in the end. There are multiple buttons which give you different amounts of points. The last button is a "are you finished button" where your points will add up and you will get your result. I tried testing this by pressing the button which will give you 200 points. But nothing happened. Anyone know what is wrong?
var poeng = 0;
function answerOne() {
poeng = 200;
console.log(poeng)
check()
}
function answerTwo() {
poeng = -300;
console.log(poeng)
check()
}
function answerThree() {
poeng = 500;
console.log(poeng)
check()
}
function answerFour() {
poeng = 600;
console.log(poeng)
check()
}
function answerFive() {
if(poeng == 200) {
poeng = poeng + 0;
console.log(poeng)
check()
}
else if (poeng == -300) {
poeng = poeng - 300;
console.log(poeng)
check()
}
else if (poeng == 500) {
poeng = poeng - 1000;
console.log(poeng)
check()
}
else if (poeng == 600) {
poeng = poeng + 0;
console.log(poeng)
check()
}
console.log(poeng)
check()
}
function check() {
if(poeng => 200) {
document.write('<img style="position: relative; top: 500px; left: 200px;" src="bilder/cat2.jpg">');
}
}