html - 如何使用两个按钮将一个 html 页面重定向到另外两个 html 页面?

标签 html redirect button click

我可以通过单击按钮使用以下代码连接到另一个 html 页面。

<form action="where-you-want-to-go"><input type="submit"></form>

但是我有一个问题。当页面上有两个按钮时,如何使用此代码将它们重定向到两个不同的页面?或者还有其他方法吗?

最佳答案

你可以这样做

<input type="button" onclick="window.location = 'where-you-want-to-go';">
<input type="button" onclick="window.location = 'where-you-want-to-go';">

关于html - 如何使用两个按钮将一个 html 页面重定向到另外两个 html 页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17921779/

相关文章:

html - Css 媒体查询解决问题

javascript - 动态匿名 js 函数不起作用

asp.net - 管理 ASP.NET 应用程序中的维护页面重定向

ruby-on-rails - Ruby on Rails 中的 Button_to 错误路由

css - 将复选框设置为按钮样式 - 如何添加边距?

ios - Swift - 圆形按钮

javascript - jQuery 计数跨越 div 错误

jquery - 如何更改表格行的背景?

PHP/cURL : Unable to remote login

azure - OWIN 和 Azure AD HTTPS 到 HTTP 重定向循环