解决Button标签无法A标签跳转超链接

Button写法如下(data-url后面填写目标链接)

<button onClick="Gopage(this)" data-url="https://www.baidu.com">打开新页面</button>

复制以下内容到网页底部

<script>
function Gopage(a){
  window.open(a.getAttribute('data-url'));
}
</script>
打赏
评论区
头像