0

I want a link to get clicked on page load. For this I have added this script in my code:

$(document).ready(function(){
 $('#id').trigger('click') 
});

This document.ready() function works fine, If I test it to alert a message. But the link is not getting clicked on page load using this. Can someone please guide me for this?