I want to initiate cart submission automatically. I have
<a href="javascript:alert('javascript');" onclick="alert('onclick')" class="simpleCart_checkout hudbtn primary right">Checkout</a>
And javascript
<script>
$('.simpleCart_checkout').trigger('click');
</script>
So I get alert click on page load but not javascript alert and simple cart not submitting data. So what more do I need to trigger so it will fully imitate link click?
Thanks
PS
When I click mouse on Checkout simplecart submits data to another page with cart items etc. But if I try imitate click alert happen only but not cart submission.
First thing is 1st. Remove all the inline silliness from the DOM element:
Second. If you are going to use jQuery, use jQuery!
Demo: http://jsfiddle.net/maniator/dY26m/