Could you please take a look at the code provided below? The issue I am facing is that "The variable input is supposed to hold the value of an input field, but instead it ends up storing 'undefined'."
var input = $("#input-item").val();
var count = 0;
$(document).ready(function() {
$("#add-item").click(function() {
if(input !== "" || input !== null) {
$("#ulTodo").append("<li " + "name=li" + count + ">" + input + "</li>");
count += 1;
}
else {
return false;
}
});
});