Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用JQuery选择ID为的div并在页面加载时自动单击它_Javascript_Jquery - Fatal编程技术网

Javascript 使用JQuery选择ID为的div并在页面加载时自动单击它

Javascript 使用JQuery选择ID为的div并在页面加载时自动单击它,javascript,jquery,Javascript,Jquery,我的页面上有一个div,ID为#activateeditbutton。我希望在加载页面时自动单击此div 下面是我用jQuery编写的代码,但它似乎不起作用。如果有人能指出我的错误,我将不胜感激。谢谢 <script type="text/javascript"> jQuery(document).ready(function(){ $('#activateeditbutton').simulate('click'); }); </script> jQuery

我的页面上有一个div,ID为
#activateeditbutton
。我希望在加载页面时自动单击此div

下面是我用jQuery编写的代码,但它似乎不起作用。如果有人能指出我的错误,我将不胜感激。谢谢

<script type="text/javascript">

jQuery(document).ready(function(){
  $('#activateeditbutton').simulate('click');
});

</script>

jQuery(文档).ready(函数(){
$(“#激活EditButton”).simulate('click');
});
试试这个

jQuery(document).ready(function(){
      $('#activateeditbutton').trigger('click');
    });
试试这个

jQuery(document).ready(function(){
      $('#activateeditbutton').trigger('click');
    });
你需要使用

你需要使用


哇!我完全认为jQuery无法执行用户操作。。。我现在觉得很傻,哈哈。谢谢哇!我完全认为jQuery无法执行用户操作。。。我现在觉得很傻,哈哈。谢谢