我怎样才能在一个单一的点击两个标签打开两个网址? [英] How can I open two urls in two tabs in a single click?

查看:100
本文介绍了我怎样才能在一个单一的点击两个标签打开两个网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个网址 -
http://www.example.com >


http://www.nana.com

I have 2 urls
http://www.example.com
and
http://www.nana.com

如果我点击下面的链接,上面的两个网址应该在两个标签页中打开。

a href =#>点击/ a

If I click the below link the above 2 urls should open in two tabs..
a href="#">Click /a

任何人都可以帮助我实现这一目标吗?

May anyone help me to acheive this one?

预先感谢

Thanks In advance

推荐答案

p>

Try something like this :

<a id="test" href="#"> CLick </a>
<script type="text/javascript">

  document.getElementById("test").onclick = function(){
   window.open("http://www.google.com",'_blank');
   window.open("http://www.p3php.in",'_blank');
}
</script>

这篇关于我怎样才能在一个单一的点击两个标签打开两个网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆