С использованием технологии
j0hnik
Добавляете, меняете...
<ul class="list">
</ul>
<button id = "add">Добавить</button >
<button id = "stop">Хватит</button >
<script>
var list = document.querySelector('.list');
document.querySelector('#add').onclick = function() {
document.querySelectorAll("li").forEach(el=>el.contentEditable = false);
var el = document.createElement('li');
el.innerHTML = "Type your task...";
el.setAttribute("contenteditable",true);
list.appendChild(el);
}
document.querySelector('#stop').onclick = function() {
list.querySelectorAll("li").forEach(el=>el.contentEditable = false);
this.style.display = "none";
document.querySelector('#add').style.display = "none";
list.querySelectorAll('li').forEach(el=>el.onclick = function(){
alert(this.innerHTML)
});
}
</script>