(el)
| 100 | } |
| 101 | |
| 102 | function selectAllInEditable(el) { |
| 103 | const doc = el.ownerDocument |
| 104 | const win = doc.defaultView |
| 105 | el.focus() |
| 106 | const range = doc.createRange() |
| 107 | range.selectNodeContents(el) |
| 108 | const sel = win.getSelection() |
| 109 | sel.removeAllRanges() |
| 110 | sel.addRange(range) |
| 111 | } |
| 112 | |
| 113 | function unmarkAll(marker) { |
| 114 | document.querySelectorAll('[' + marker + ']').forEach(n => n.removeAttribute(marker)) |