Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bookmarklet to toggle ContentEditable
javascript:(function(e,n,o,t){o=e.body,t=%22true%22==o[n],o[n]=t%3F%22false%22:%22true%22,e.designMode=t%3F%22off%22:%22on%22})(document,%22contentEditable%22)
(function () {
if (document.body.contentEditable === 'true') {
document.body.contentEditable = 'false';
document.designMode = 'off';
} else {
document.body.contentEditable = 'true';
document.designMode = 'on';
}
}())
(function(d,e,b,s){b=d.body;s=b[e]=='true';b[e]=s?'false':'true';d.designMode=s?'off':'on'}(document,'contentEditable'))
@RAYARAYUMA
Copy link

RAYARAYUMA commented on Sep 11, 2016

t

@DerDer56
Copy link

DerDer56 commented on Jul 5, 2020

cool!

@HT-7
Copy link

HT-7 commented on Apr 23

In an old text file, I found:
if (document.designMode=='off') { document.body.contentEditable='true'; document.designMode='on';} else { document.body.contentEditable='false'; document.designMode='off';} void 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment