富文本框编辑器原理
contenteditable:
1.枚举属性
2.全局属性
document.execCommand()
1.设计模式下,允许允许命令,操纵可编辑内容区域的元素
2.三个参数( aCommandName, aShowDefaultUI, aValueArgument)
3.命令 bold,foreColor,backColor。。。。
代码演示
在div中输入文字,div中的文字选中后可以进行操作
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv=