I want that when I do mouseup i can to have the option of delete or no the list with "window.confirm". The console say "Uncaught ReferenceError: li is not defined".
var add = document.getElementById('create-memo');
function newMemo(list, itemText){
var listMemo = document.createElement('li');
listMemo.className = 'memo';
listMemo.innerText = itemText;
list.appendChild(listMemo);
listMemo.addEventListener('mouseup', removeList);
}
function removeList(){
if (window.confirm('You want remove this memo?')) {
li.parentNode.removeChild(listMemo);
}
}
UPDATED
Check out this running demo. I hope it's what you are looking for.