I had an html navigation code as below
Use this html to get the clicked element:
This Month Year 60 Days 90 Days
Script:
function Data(string, el) { $('.filter').removeClass('active'); $(el).parent().addClass('active'); }