Opening an url in same window

Opening an url in same window

First create the javascript function:

function selfWindow(){
window.location.href = ‘http://www.ambedkar.org’;
}

then call that function on ‘onClick’ event on button or on anchor link
<input type=”button” onclick=”selfWindow();” value=”open”>

<a href=”#” onclick=”selfWindow();“>Open this</a>

Leave a Reply