1

我的桌面上有 2 个 html 文件(login.html 和 firstpage.html)。我在 login.html 中有一个按钮。当我按下该按钮时,我需要导航到 firstpage.html 屏幕。

我试过像下面这样;我在 login.html 页面中写了这个,但它不起作用,

<form name="myform">
<input type="button" value="Enter" width="100px" onclick="<a href ='C:\Users\Desktop\firstpage.html'</a>">
</form>

谁能帮我解决这个问题。谢谢

4

3 回答 3

1

更改代码

<form name="myform" action="firstpage.html">
<input type="submit" value="Enter" width="100px">
</form>
于 2013-06-25T14:03:00.720 回答
0

像这样对您的代码进行轻微更改

<a href ='C:\Users\documents\firstpage.html'><input type="button" value="Enter" width="100px"></input></a>

这应该工作...... :)

于 2013-06-25T14:34:03.407 回答
0

要链接这两个文件,您只需将它们放在同一个文件夹中,然后使用以下行:

<input type="button" value="Enter" width="100px" onclick="document.location='firstpage.html'">

您不需要表格来执行此操作。

您的 onclick 处理程序不需要 html,只需要 javascript。

你也可以这样做:

<a href="firstpage.html">Go to page</a>
于 2013-06-25T14:03:54.847 回答