单击链接时删除超链接

时间:2018-12-19 14:49:58

标签: jquery css

默认链接:localhost/sample-page/

目标链接:localhost/sample-page/#bottom

<a href="#bottom">
  <div class="arrow"></div>
</a>
<div class="container" id="bottom">

此链接在同一页面中,方案是单击链接后将转到localhost/sample-page/,但显示localhost/sample-page/#bottom

单击#bottom时如何删除a

1 个答案:

答案 0 :(得分:0)

在href标签中添加原始链接。选中此URL https://jsfiddle.net/shoesheill/w7j16mqp/1/

<a href="https://jsfiddle.net/shoesheill/w7j16mqp/1/">
 <div class="arrow">Button</div>
 </a>
 <div class="container" id="bottom">