[英]How to do two events in one link <a href..>: to external page (_blank) and to internal page (_self) in event onClick?
I have a link on site: <a href="https://paypal.com/..." title="Pay now on PayPal"...>Pay now</a>
.我在网站上有一个链接: <a href="https://paypal.com/..." title="Pay now on PayPal"...>Pay now</a>
。 Needs to do next actions:需要做的下一步操作:
Think its about using event(s) onClick in <a href="#" onClick="...">Pay now</a>
, but I can`t find working example of this task.考虑在<a href="#" onClick="...">Pay now</a>
使用 onClick 事件,但我找不到此任务的工作示例。 Please, help in this question to do working button.请帮助解决这个问题以完成工作按钮。
Call this function on your button click:单击按钮时调用此函数:
function onClick() {
window.open("https://www.google.com", "_blank");
window.location.href = "https://www.facebook.com";
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.