站内搜索:
首页 >> 前端 >> 内容
超链接的一些操作代码

时间:2018/4/2 15:40:42

取消超链接默认效果

[html] view plain copy

<a href="javascript:void(0)" onclick="myfunction()">超链接名字</a>  

        回退上一个页面是“-1”,以此类推,2就是前进两个页面。

[html] view plain copy

<a href="javascript:history.go(-1)" style="font-size: 22px">返回文章列表</a>  

        锚记标签

[html] view plain copy

<a href="#top">顶部</a>  

[html] view plain copy

<a href="#top" style="font-size: 22px">返回顶部</a>  

        因此,取消超链接的默认效果可以这样:

[html] view plain copy

<a href="#">点击量</a>  

  • 上一篇:jQuery.parent()方法使用实例
  • 下一篇:对象.和对象[]的区别讲解
  • 返回顶部