I have a button at the bottom of a form that when is pressed I would like to open up a new URL in the same window. Right now with the code I have it opens up a new window /tab. If I put ,"_self" after the url, the button breaks completely. Here is my code
$(".study-btn").click(function(){
if(questionCounter == 3)
{
window.open("http://www.google.com");
// I tried this but breaks completely
window.open("http://www.google.com", "_self");
}
else
{
window.open("http://http://www.amazon.com");
}
});
The question counter is just to me to figure out which of the form questions have been answered YES or NO.