首页javascriptanchorjQuery HTML Element - 如何触发对锚链接的点击...

jQuery HTML Element - 如何触发对锚链接的点击...

我们想知道如何触发对锚链接的点击。...

<html>
<script>
        function explode() {
                pp = document.getElementsByTagName("a");
                var a='';
                for(i=0;i<pp.length;i++) {
                  a+=pp[i].href
                }
                document.write(a);
        }
</script>
<body>
  <a href="http://google.com">Google</a>
  <a href="http://yahoo.com">Yahoo</a>
  <button onclick="explode()">Explode</button>
<body>
</html>