Here is my menu:
<div class="portfolio-item-filter" id="work-filter">
<a class="gdlr-button active" href="#" data-category="All">Work</a>
<a class="gdlr-button" href="#" data-category="film">Film</a>
<a class="gdlr-button" href="#" data-category="print">Print</a>
</div>
I'm trying to click in the film button when page is loaded but I have no success. Reading in several places, this is the result that I got, but does not work
jQuery(document).ready(function() {
jQuery('a[data-category="film"]')).trigger( "click" );
});
I have a limited knowledge on JavaScript
and jQuery
, so probably I'm using the right script in the wrong place or in a bad way.
Can you please support me?