I have added following code in wordpress to hide status bar. It works but I want to open link in new window. How can I do that?
<img style='cursor:pointer;' src='http://www.killerpreseller.com/images2/buynow.gif' onclick="window.location='http://www.yahoo.com'"/>
You can use:
window.open('http://www.killerpreseller.com/images2/buynow.gif', '_blank');
As per How to simulate target="_blank" in JavaScript
This is the equivalent of an anchor tag with target='blank' set.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments