Variable to store the ID of the item (initialized to -1).
Variable: item_id
var item_id = -1;
Event listener to execute code after the DOM content is fully loaded.
document.addEventListener("DOMContentLoaded", function() {
// ... Event listener code ...
});
Function to add a new item or update an existing item based on the form inputs.
Parameters:
function addItem() {
// ... Function code ...
}
Function to clear the form by resetting input values and unchecking checkboxes.
Parameters:
function clearForm() {
// ... Function code ...
}