execCommand 命令的用途总结

    xiaoxiao2025-12-06  3

    execCommand:

    有很多命令,我按照样式和功能来分.样式包括颜色,字体,等静态展示内容..功能按照 增删改查,编辑的动作来分.

    样式用途:

    backColor:背景

    bold:粗体

    contentReadOnly:内容只读

    decreaseFontSize:减小字体

    fontName:

    fontSize

    foreColor

    formatBlock

    enableInlineTableEditing:使行可以编辑

    enableObjectResizing:使图片可以编辑

    hiliteColor:改变背景颜色

    increaseFontSize:增大字体

    indent:增加缩进

    outdent:减少缩进

    justifyRight:光标插入位置或者所选内容 右对齐

    justifyLeft:光标插入位置或者所选内容 左对齐

    justifyFull:光标插入位置或者所选内容 文本对齐

    justifyCenter:光标插入位置或者所选内容 文本居中

    italic:在光标插入点开启或关闭斜体字

    removeFormat:去掉所有样式

    underline:在光标插入点开启或关闭下划线

    superscript:在光标插入点开启或关闭上角标

    strikeThrough:在光标插入点开启或关闭删除线

    编辑用途:

    copy:

    createLink:

    cut:

    delete:

    forwardDelete

    insertBrOnReturn

    insertHTML

    insertHorizontalRule

    insertImage

    insertParagraph

    insertText

    insertUnorderedList

    insertOrderedList

    paste:黏贴

    redo:重复撤销的动作

    undo:撤销

    unlink:去掉所有a标签的link

    selectAll:选择所有的文本内容

    可以做一个比较完善的文本编辑器了(*^__^*) 嘻嘻……

    转载请注明原文地址: https://ju.6miu.com/read-1304668.html
    最新回复(0)