So I created an item name where i display as the name says the item name and same for item money, and then i have a button that i want to get the values of the item name and item money but it gives me 0
// Update table
var expenseTitle = document.createElement("li");
expenseTitle.innerText = expenseName.value;
expenseTitle.classList.add("title-item");
expenseTitle.id = "item-title";
table.appendChild(expenseTitle);
var expenseMoney = document.createElement("li");
expenseMoney.innerText = expenseAmmount.value + "$";
expenseMoney.classList.add("value-item");
table.appendChild(expenseMoney);
var editBtn = document.createElement("button");
editBtn.innerHTML = "<i class='fas fa-edit'></i>";
editBtn.classList.add("edit-btn");
editBtn.onclick = () => {
// here when i log the expenseTitle value gives me 0
console.log(expenseTitle.value);
// same stands for expenseMoney
console.log(expenseMoney.value);
expenseTitle.remove();
expenseMoney.remove();
editBtn.remove(), deleteBtn.remove();
};
table.appendChild(editBtn);