在本页转向新页面(本页被新页面覆盖):
<input type="button" value="登录"
οnclick="window.location.href='index.html'">
打开一个新的页面进行跳转(本页不关闭):
<input type="button" value="注册"
onclick="window.open('login.html')">
本文介绍了两种网页跳转方式:一种用于登录,点击按钮后本页被新页面(index.html)覆盖;另一种用于注册,使用window.open()方法打开新页面(login.html)而不关闭当前页。这些技术对于前端开发人员理解和实现用户交互至关重要。
在本页转向新页面(本页被新页面覆盖):
<input type="button" value="登录"
οnclick="window.location.href='index.html'">
打开一个新的页面进行跳转(本页不关闭):
<input type="button" value="注册"
onclick="window.open('login.html')">
1831
3590
1万+

被折叠的 条评论
为什么被折叠?