在新窗口中打开按钮? [英] Open button in new window?

查看:152
本文介绍了在新窗口中打开按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么会去制作按钮,在新窗口中打开,模仿A HREF,TARGET = _blank?

How would I go about making the button open in a new window, emulating "a href, target = _blank"?

我目前有:

<button class="button" onClick="window.location.href='http://www.site.com';"><span class="icon">Open</span></button>

按钮不是一个形式,我只是想使其在新窗口中打开。

The button isn't in a form, I just want to make it open in a new window.

推荐答案

打开您所提供的网址一个新窗口:)

Opens a new window with the url you supplied :)

<button class="button" onClick="window.open('http://www.site.com');"><span class="icon">Open</span></button>

希望帮助:)

这篇关于在新窗口中打开按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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