I have two tabs, below is the HTML code for both:
<input type="button" value="Activos" id="tab-active" class="active">
<input type="button" value="Inactivos" id="tab-inactive">
And I create this code to change between tabs:
$("#tab-inactive").click(function() {
var current = $(this);
$("#tab-active").removeClass("active");
current.addClass("active");
$("#layout-center").load(Routing.generate('inactive_product'));
});
$("#tab-active").click(function() {
var current = $(this);
$("#tab-inactive").removeClass("active");
current.addClass("active");
$("#layout-center").load(Routing.generate('product_list'));
});
The code works but I'll like to know if exists a better way/path to do this, any improvements or something around this in order to optimize and minimize the code