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

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

我在使用 Spring Tool Suite 的 Bootstrap 中工作。我有一个我制作的 html 页面 (reprint-emblems-reports.html),我希望在单击 Go 按钮后显示此页面。我正在通过本地主机工作。该网站不是实时的。我是 html 新手。

这是 Go 按钮的代码。

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

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

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

我希望单击“开始”按钮打开一个新选项卡并显示 reprint-emblems-reports.html 页面。

谢谢

最佳答案

您可以在按钮上添加“onclick”属性:

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

window.open() 可以打开新标签页或新窗口(取决于您的浏览器配置)

关于html - 单击按钮链接到新窗口中的 html 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34188165/

相关文章:

html - Bootstrap 4 创建六列布局

android - 从动态 View 中识别按钮

html - 如何将多行按钮与其中的不同文本对齐?

html - Bootstrap 模板迁移到 ASP.NET 4.5 表单 - 全 Angular 呈现问题

javascript - 如何使用 jQuery 自动打开页面上的所有链接?

javascript - 让所有没有某个类(class) child 的 parent

html - HTTPS 性能 : absolute vs relative urls

html - 使可扩展搜索适合空间

html - 在 View 中间添加一条垂直线

java - 单击按钮时修改变量/其他 Swing 对象