I'm trying to do a prompt which will lead me to another site but I want the other site to replace the current window I was in.
The code:
<button id="butt">press</button>
<script>
document.getElementById('butt').onclick = function()
{
var age = parseInt(prompt("please enter your age", "18")); //parseInt turns the string to numbers
if(age >= 18)
{
window.open('http://www.walla.co.il','walla');
}
}