5 ms·
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 ed
by blacksmith_tb 4y 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')});
- personjerry 4y agoEditable 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
- jcparkyn 4y agoBonus tip: set `display: block` on a style tag and add `contenteditable`, then users can even edit your page styles in real-time.
- paulcole 4y agoWhen 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.