Search code examples
jqueryhref

jquery force click (href)


I have this:

<li>
 <a href="#" data-content="visit">
  <span class="bf_hover"></span>
  <span>Visit us</span>
 </a>
</li>

And I want to automatically open the "Visit Us" link.

How I can do this ?


Solution

  • You can trigger a click by doing

    $('li a').trigger('click');