showing results for - "js contenteditable button spacebar"
Mika
02 Sep 2019
1const button = document.querySelector('button[contenteditable]')
2
3button.addEventListener('keydown', function (event) {
4  if (event.code !== 'Space') {
5    return
6  }
7  event.preventDefault()
8  document.execCommand("insertText", false, ' ')
9})
10
similar questions
queries leading to this page
js contenteditable button spacebar