I have this code:
<div class="navi">
<a onclick="GetTagDataOnPageChangeNumeric(1,5)" href="#"></a>
<a onclick="GetTagDataOnPageChangeNumeric(2,5)" href="#" ></a>
<a onclick="GetTagDataOnPageChangeNumeric(3,5)" href="#" class="active"></a>
<a onclick="GetTagDataOnPageChangeNumeric(4,5)" href="#"></a>
<a onclick="GetTagDataOnPageChangeNumeric(5,5)" href="#"></a>
</div>
… and when a next/prev button is clicked, i.e.
<div class="next">Next</div>
<div class="prev">Prev</div>
I need the Jquery to reset active class to the first <a> and fire the onclick event for the first <a> too.
I’ve got $('.navi a').removeClass('active'); but don’t know how to fire the first onclick event.
$('.navi a:first-child').addClass('active');
Many thanks
EDIT,
In this case you know what function is, why don’t you just call
Also, make sure you run it when the page is ready: