Making orderlist by java script

var orderListElement = document.getElementById(“listbox”)
var inputElement = document.getElementById(“inputtext”)

inputElement.addEventListener(“keypress”,function(e){
if(e.key == “Enter”){
var listElement = document.createElement(“li”);
listElement.innerText = e.target.value;
orderListElement.appendChild(listElement)
}
})

1 Like