internet explorer alternative to document.execCommand(“insertText”,…), for text insertion that can be undone/redone by the user

前端 未结 2 1143
予麋鹿
予麋鹿 2020-12-17 18:22

When the user edits a contenteditable div, and press some keys, I would like to override the default behavior. For instance, I want to insert a normal line brea

2条回答
  •  旧巷少年郎
    2020-12-17 18:33

    You can always go the simpler and more stable way to catch the change event on the input div and change the last char from the input string to your liking.

    http://api.jquery.com/change is invented i think for that purpose :)

    Change your angel and you see a whole new world :3

提交回复
热议问题