So how do I require the input field in my form not to be empty when clicking on the submit button? I don't want to use the HTML attribute require. My HTML and JS code are below if someone is interested in taking a look

JS:

```
let form = document.getElementById("addForm");

// Form submit event
form.addEventListener("submit", addItem);

// Add item
function addItem(e){

e.preventDefault();
console.log(e);

// Get input value

let newItem = document.getElementById("item").value;

// Create new li
let newLI = document.createElement("li");
// Add class

newLI.className = "list-group-item";
// Add text node with input

newLI.textContent = newItem;

//Delete button

let button = document.createElement("button");
button.className = "btn btn-danger btn-sm float-right delete";
button.textContent = "X";
newLI.appendChild(button);

itemList.appendChild(newLI);
document.getElementById("item").value = "";

} 

```

HTML:

```
    <form id="addForm" class="form-inline mb-3">
      <input type="text" class="form-control mr-2" id="item">
      <input type="submit" class="btn btn-dark" value="Submit">
    </form>

```