I have the following function, which fills the list with items. But I also would like to create a function, which clears the whole content of the list, how should I do it?
Here is the function itself:
function listFiller() {
var list = document.getElementById('list');
var entry = document.createElement('li');
entry.appendChild(document.createTextNode(guessedWord));
entry.appendChild(document.createTextNode(" - "));
entry.appendChild(document.createTextNode(seconds));
list.appendChild(entry);
}
Also, how could I specify that the items should be added to the top of the list?