My page is supposed to redirect from the root page on my website to one of two different subpages, linked via buttons on the root page. The buttons don't work.
This is my code:
HTML:
<!DOCTYPE html>
<html>
<head>
<title>My name</title>
<link rel="stylesheet" href="styles.css">
<script src="js.js"></script>
</head>
<body>
<div class="navbar">
<input type="button" class="button" value="My GitHub portfolio" onclick="page1();">
<br>
<input type="button" class="button" value="Start Page" onclick="page2();">
</div>
</body>
</html>
JS:
var pageto;
function page1(){
var pageto = 1;
reload();
};
function page2(){
var pageto = 2;
reload();
};
function reload(){
if (pageto == 1){
location.href('personal-website');
}
else if (pageto == 2){
location.href('start-gp');
};
};