document.execCommand 实现简单的富文本编辑器

来源:互联网 发布:cntv live for mac 编辑:程序博客网 时间:2024/04/29 16:13
参考文档:http://blog.csdn.net/woshinia/article/details/18664903

官方文档:https://developer.mozilla.org/zh-CN/docs/Web/API/Document/execCommand



主要针对当前选中元素生效

第一个参数是命令名称,第二个参数固定false,第三个参数 命令需要的参数




document.execCommand("createLink",false,"http://www.baidu.com");






0 0