通过按钮链接到新窗口中的html页面单击

时间:2015-12-09 20:15:17

标签: html twitter-bootstrap button window spring-tool-suite

我在Spring Tool Suite的Bootstrap中工作。我有一个html页面(reprint-emblems-reports.html),我希望在按下Go按钮后显示该页面。我正在通过localhost工作。该网站不在线。我是html的新手。

以下是Go按钮的代码。

<button type="button" class="btn btn-aramark-primary">Go</button>

Go按钮位于reprint-emblems.html内。

reprint-emblems-reports.html位于同一文件夹(reprint-emblems)

我想点击Go按钮弹出一个新标签,并显示reprint-emblems-reports.html页面。

谢谢

2 个答案:

答案 0 :(得分:2)

您可以添加&#34; onclick&#34;按钮上的属性:

<button type="button" class="btn btn-aramark-primary" onclick="window.open('/your-path')">Go</button>

window.open()可以打开一个新选项卡或新窗口(取决于您的浏览器配置)

答案 1 :(得分:1)

您可以使用javascript

<button onclick="window.location.href='/your path here'" type="button" class="btn btn-aramark-primary">Go</button>
相关问题