页面打开直接执行a点击事件

Posted djdliu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了页面打开直接执行a点击事件相关的知识,希望对你有一定的参考价值。

<script>
    window.onload = function(){
        function autoclick(){
            var url = document.getElementById(btn).href;//获取要点击的a标签
            window.location.href= url;
        }
       
        setTimeout(autoclick, 1000)
    }
</script>

 

以上是关于页面打开直接执行a点击事件的主要内容,如果未能解决你的问题,请参考以下文章