[英]How to redirect a html page to two other html pages using two buttons?
I can connect to another html page by using the following code by using a button click. 我可以使用以下代码通过单击按钮连接到另一个html页面。
<form action="where-you-want-to-go"><input type="submit"></form>
but I have a problem. 但我有一个问题。 When there are two buttons on the page how can I redirect them to two different pages by using this code?
当页面上有两个按钮时,如何使用此代码将它们重定向到两个不同的页面? Or is there any other way to do that?
或者还有其他方法吗?
YOU COULD DO something like this 你可以这样做
<input type="button" onclick="window.location = 'where-you-want-to-go';">
<input type="button" onclick="window.location = 'where-you-want-to-go';">
What do you mean by "redirect"? 你是什么意思“重定向”? After clicking submit button the form data is send to action url.
单击“提交”按钮后,表单数据将发送到操作URL。 If you want you can create two forms:
如果需要,可以创建两种形式:
<form action="action-first"><input type="submit"></form>
<form action="action-second"><input type="submit"></form>
But if you don't want to send data, you can use links to go to the page: 但是,如果您不想发送数据,可以使用链接转到该页面:
<a href="/action-first">First link</a>
<a href="/action-second">Second link</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.