值
一個 String,其中包含替換 updateRangeStart 和 updateRangeEnd 索引之間的文字的文字。
示例
使用 textupdate 顯示插入的文字和位置
html
<div id="editor"></div>
js
const editorEl = document.getElementById("editor");
const editContext = new EditContext();
editorEl.editContext = editContext;
editContext.addEventListener("textupdate", (e) => {
console.log(
`The user inserted the text "${e.text}" at index ${e.updateRangeStart}.`,
);
});
規範
| 規範 |
|---|
| EditContext API # dom-textupdateevent-text |
瀏覽器相容性
載入中…