I am using this to open on a new window:
<div class="backbutton" OnClick="javascript: window.open('http://www.goesback.com')">Go back</div>
How to amend this if I want onclick to open a hyperlink on the same page?
thanks.
You just set the url to the window.location.href
so
<div class="backbutton" OnClick="window.location.href = 'http://www.goesback.com'">Go back</div>
But you should really just convert it to a regular link
<a class="backbutton" href="http://www.goesback.com">Go back</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With