⊗jsPrChLDE 22 of 62 menu

Editing a task in a checklist in JavaScript

Let's now implement editing. To do this, attach double click to span with text:

let task = document.createElement('span'); task.classList.add('task'); task.textContent = this.value; task.addEventListener('dblclick', function() { // here will be the code that implements editing }); li.appendChild(task);

By double clicking on the specified span we must create an input in it with the text of this span. Then, after pressing the Enter key in this input, we must write the text of this input back to our span, and remove the input itself.

Add the missing part of the code to solve the described problem.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline