Skip to content
Advertisement

JavaScript save value of div element

I have a simple text editor and I want to save its content, but it doesn’t work because it is not an input element. It is a div element which has contenteditable='true' so I can write inside it. My question is that is there any way to save the characters that the user types in it?

I have tried the onchange='saveValue(this)' method but it is not working.

Advertisement

Answer

This appears to be answered here, along with guidance for modern browsers in some of the newer answers.

Advertisement