I'm having an issue with implementing jQuery animations for adding a new row on form submit. Additionally, I need to dynamically add and remove classes with animation effects without altering the HTML or CSS files (as this project is for school).
Here is the current jQuery code snippet:
$("form").submit(function(event) {
event.preventDefault();
var id = $("table tr").length;
var naziv = $("#naziv").val();
var cena = $("#cena").val();
var kolicina = $("#kolicina").val();
var cenaSkupaj = cena * kolicina;
var tip = $("#tip").val();
var rok = $("#rok_trajanja").is(":checked") ? "Expired" : "Not expired";
$("table").append("<tr><td>" + id + "</td><td>" + naziv + "</td><td>" + cena + " €</td><td>" +
kolicina + "</td><td>" + cenaSkupaj + " €</td><td>" + tip + "</td><td>" + rok + "</td></tr>");
});
});