HomeMake the whole document editable.

Make the whole document editable.

Published: 10/28/2022

Here's a small cool trick to make the whole document editable.

document.designMode = 'on';

This can also be used with iframes, i.e.

let iframeNode = document.getElementById('myeditor'); // or any other ways to get reference to an iframe
iframeNode.contentDocument.designMode = "on";

Try this out with the current page by clicking here!

About Code with Node.js

This is a personal blog and reference point of a Node.js developer.

I write and explain how different Node and JavaScript aspects work, as well as research popular and cool packages, and of course fail time to time.