Hacker News new | ask | show | jobs
by blacksmith_tb 1297 days ago
That made me think... it should be pretty easy to set that attribute on every element in the DOM (overkill, but then it makes every piece of text on the page editable, poof!) I can imagine giving that to not-too-technical users to play with changing things on a page - as long as they could paste a one-liner into the dev console:

document.querySelectorAll('*').forEach(function(node){node.setAttribute('contentEditable','true')});

3 comments

Editable content also supports rich text copy-and-paste, so you can literally control+c a portion of a site and control+v into a content-editable, and it will look exactly how it did on the other site :D
When I used to demo sites to clients, before the meeting started, I’d go into the inspector and set body to be contenteditable.

That way I could edit text while they talked and at the end of the meeting I’d just do a full-page screenshot.

The problem with letting non-technical users have at it is that they don’t realize it’s temporary.

Bonus tip: set `display: block` on a style tag and add `contenteditable`, then users can even edit your page styles in real-time.