javascript - 如何在 HTML JavaScript 自定义文本格式化程序中实现减少缩进?

标签 javascript html angular execcommand

我正在使用自定义文本格式化程序组件。我使用下面的代码来实现其他功能(粗体、斜体、缩进等),但是我在这里没有发现减少缩进。

document.execCommand(aCommandName, aShowDefaultUI, aValueArgument)

我该如何实现这个?

最佳答案

有用于制表符的 indent 和 outdent execCommand 函数。像这样:

缩进 -- doc.execCommand('indent', true, null);

Outdent -- doc.execCommand('outdent', true, null);

关于javascript - 如何在 HTML JavaScript 自定义文本格式化程序中实现减少缩进?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40043352/

相关文章:

javascript - AngularJS : Getting data from Factory and update Controller scope and view

html - 使一个 div 显示在另一个下方

html 电子邮件 - 将元素向下移动页面?

typescript - Angular2 导入路径在运行时错误

angular - Typescript - 执行文件中的代码而不导入它们

javascript - 使用 ngIf 时无法找到 div

javascript - 为什么在我的 Bootstrap Tour 过程中所选元素并不总是弹出?

javascript - 如何使用 Addon SDK 操作 Firefox UI?

javascript - 如何在图片较多的网页上实现平滑滚动?

html - CSS ticker 不能完全工作