设置盒子类容可以编辑

1、添加contenteditable属性让文本处于可编辑状态,

contenteditable: "inherit";(默认)
contenteditable: "plaintext-only";(输入纯文本)
contenteditable: "true";
contenteditable: "false";
contenteditable: "caret";(符号)
contenteditable: "events";(不知道搞啥用的)

2、利用css的user-modify
user-modify: read-only;
user-modify: read-write;
user-modify: write-only;(暂不支持)
user-modify: read-write-plaintext-only;(输入纯文本,暂时只有谷歌支持:
-webkit-user-modify: read-write-plaintext-only)

posted on 2022-09-20 13:51  马玉豪  阅读(43)  评论(0)    收藏  举报

导航