I have this code that should change the contents of a table position when you change the contents of nameDiv which is var nameDiv = document.createElement('div'); (nameDiv.contentEditable = "true";) and it has some text
nameDiv.onclick = event => {
allSectionsArray[sectionNumber][2] = event.value;
}
What happens here is basically: it updates the second I click on the div and not after some text is entered.
What I want is: to save changes after entering the text. Is there any substitute of onclick or any other method that I can achieve this?