xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

js & document.designMode

js & document.designMode

js 一键开启页面编辑模式

var mode = document.designMode;
document.designMode = value;

https://developer.mozilla.org/en-US/docs/Web/API/Document/designMode

document.designMode

document.designMode;
// "off"

document.designMode = "on";
// "on"

document.designMode;
// "on"

https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand

HTMLElement.contentEditable

editable = element.contentEditable
element.contentEditable = 'true'

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable

demo

refs



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2021-01-01 21:38  xgqfrms  阅读(109)  评论(2编辑  收藏  举报