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