Hi, I want to know if I can change the class of <i>
with jquery that is with .attr but I do not know how to capture the or select the <i>
,
what I want is that when I click on the class I know that it is an icon, change it to another class="fa fa-minus"
I leave my code of my button.
BUT WHEN YOU AGAIN CLICK ON THE OTHER CLASS
<div onclick="detalle_venta(9)" class="text-center details-control">
<a><i class="fa fa-plus-circle fa-2x"></i>
</a>
</div>
$('#tabla_ventas tbody').on('click', 'div.details-control', function () {
var tr = $(this).closest('tr');
var row = tabla_ventas.row(tr);
$.ajax({
url: baseurl + 'Caja/traer_detalle',
type: "POST",
cache: false,
data: {codigo: codigo},
success: function (result) {
if (row.child.isShown()) {
row.child.hide(result);
tr.removeClass('shown');
} else {
row.child(result).show();
tr.addClass('shown');
}
},
error: function (result) {
alert("error");
}
});
});