Reputation: 111
I have a div on my page with the ID of #activateeditbutton
. I want this div to be automatically clicked when the page loads.
Here is the code I have written in jQuery, but it does not seem to work. If someone can point out my mistake I would greatly appreciate it. Thanks.
<script type="text/javascript">
jQuery(document).ready(function(){
$('#activateeditbutton').simulate('click');
});
</script>
Upvotes: 1
Views: 362
Reputation: 133403
You need to use .trigger()
$('#activateeditbutton').trigger('click');
Upvotes: 1
Reputation: 3385
Try this,
jQuery(document).ready(function(){
$('#activateeditbutton').trigger('click');
});
Upvotes: 5