Remove dynamically stored variable

I’m currently learning jQuery / Javascript and I am struggling to figure out how to delete a variable as well as the element (I don’t know the correct name for this method). Hopefully the following code will make a bit more sense. I also made a quick video of what’s happening

// Var
var output = $(".total h2");
et = 0;

// Add expense
function add() {
var en = $("input#expenseName").val();
var ep = $("input#expensePrice").val();
et = et + parseInt(ep);
console.log(et)
$("table").append("<tr>" + "<td id='name'>" + en + "</td>" + "<td id='list'>" + ep + "</td>" + "<td id='delete'>" + "<i class='material-icons'>delete</i>" + "</td>" + "</tr>");
}

// Delete function
$(document).on('click', '#delete', function() {
$(this).animate({
opacity: 0,
}, 500, function() {
$(this).parent().remove();
})
})


Download remove.dynamically.stored.variable.zip
Direct Link


Download


Download remove.dynamically.stored.variable.zip
Mediafire


Download


Download remove.dynamically.stored.variable.zip
2Shared


Download

Both comments and pings are currently closed.

Comments are closed.