比较完整的写法:<a href="链接">
<input type=button onclick="window.location.href('连接')">
</a>
注:1.若直接在本页跳转到新的页面,则用: <input type=button onclick="window.location.href('连接')">
2.如果需要打开一个新的页面进行跳转,则用: <input type=button onclick="window.open('连接')">
本文介绍如何使用HTML与JavaScript实现网页内的跳转及新窗口打开的功能。提供了两种常见场景下的代码实例:一是直接跳转到新页面;二是打开新窗口进行跳转。适合初学者快速上手。
1664

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