I'm trying to do what I think is a really simple thing, and I can't find any working solutions online. Basically, I want links in if statements. The pages I want to navigate to are in the same folder as the index-page.
Here are the if-statements:
if(cartman > kyle && cartman > stan && cartman > kenny && cartman > butters){
window.location = 'cartman.html';
}
else if(kyle > cartman && kyle > stan && kyle > kenny && kyle > butters){
window.location = 'kyle.html';
}
else if(stan > cartman && stan > kyle && stan > kenny && stan > butters){
window.location = 'stan.html';
}
else if(kenny > cartman && kenny > stan && kenny > kyle && kenny > butters){
window.location = 'kenny.html';
}
I have found many different codes online that are supposed to do this, but none of them have worked. What is the correct way to use javascript to navigate to another page?