How can I make HTML not be editable within a contenteditable web page? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

How can I make HTML not be editable within a contenteditable web page?

https://code.sololearn.com/Wu3dWe7vdWHO/?ref=app I want the red box to be non editable when made in the dom and I want the big black box containing it to be editable. I thought the solution I tried would work, but it doesn’t and I’m not sure why. If someone has some insight or a solution, that would be greatly appreciated.

12th Dec 2018, 2:03 AM
Thomas Czernek
Thomas Czernek - avatar
1 Respuesta
+ 3
change `getX.contentEditable` to `x.contentEditable`! `getX` returns nothing by the way, because you are searching the DOM before you inserted your box.
12th Dec 2018, 3:23 AM
Schindlabua
Schindlabua - avatar