您的位置:首页 > 技术中心 > 前端框架 >

html怎么点击按钮跳转页面

时间:2022-02-11 16:29

html点击按钮跳转页面的方法:1、在button标签外嵌套一个a标签,利用超链接进行跳转;2、在button标签中添加“onclick="window.location.href='页面url'"”代码,使用onclick事件进行跳转。

本教程操作环境:windows7系统、HTML5版、Dell G3电脑。

方法1:在button标签外套一个a标签

<a href="https://www.gxlsystem.com/">
	<button>进入PHP中文网</button>
</a>

效果图:

1.gif

方法2:使用onclick事件

<button onclick="window.location.href = 'https://www.gxlsystem.com/'">进入PHP中文网</button>

效果图:

2.gif

推荐教程:《html视频教程》

以上就是html怎么点击按钮跳转页面的详细内容,更多请关注gxlsystem.com其它相关文章!

本类排行

今日推荐

热门手游