Javascript newbie need help: How to change button link after user first click

This is my first javascript code. Am trying to change the text within a button to another text after the user’s first click and at the same time have both buttons link to another webpage. I have come up with the code below but it doesn’t work and I honestly don’t know how to link the buttons to another webpage. Need help urgently


<!DOCTYPE html>
<html>
<head>

<script language="javascript" type="text/javascript">
<!--
var clickcount=0
var txt = "Begin Wedding Planning!" + ("http://www.app4brides.com");
var txt2 = "Continue Wedding Planning!" + ("http://www.app4brides.com");
function clickcount(){
if(clickcount++)
{
document.getElementById("txt2").value="Continue Wedding Planning!";

}
}

</script>
</head>
<body>
<input type="button" onclick="clickcount()" value="Begin Wedding Planning" id="txt"></input>
</body>
</html>


You might need to say more about what you are trying to do, as it’s not clear to me, at least. Is it really a button you want, and not an anchor?

I want the buttons to both act as anchors. Such that when a user clicks on the first button (begin wedding planning), she is taken to a webpage but gets to the site a second time the button becomes (continue wedding planning) and is taken to the same webpage as the first button. I reorganizing my script but it still isn’t working

<!DOCTYPE html>
<html>
<head>
<script>
var clickcount=0
var txt = "Begin Wedding Planning!" + ("http://www.app4brides.com");
var txt2 = "Continue Wedding Planning!" + ("http://www.app4brides.com");
function clickCounter(){
if (localStorage.clickcount)
{
localStorage.clickcount=Number(localStorage.clickcount)+1;
}
{
document.getElementById("txt2").value="Continue Wedding Planning!" + ("http://www.app4brides.com");
}
}
</script>
</head>
<body>
<button type="button" onclick="clickCounter()" id="demo">Begin Wedding Planning!</button>
</body>
</html> 

You don’t have anywhere in your HTML that has id=“txt2” for the getElementById to interact with.

Also try moving the script to just before the </body> tag where 99.999% of JavaScript runs best.