How can I highlight multiple HTML elements and remove them by pressing the Backspace
key? WordPress block editor and Editor.js has this feature. Users can select/ Highlight multiple block
and remove them by pressing the Backspace
key.
From this code below, If I highlight by selecting(mouse) not by clicking the .block-1, .block-2, .block-3
and press Backspace
key then it should delete these elements.
[NOTE]
- Every block should have contenteditable attribute.
- Please, go to Editor.js first for demo what I exact want.
<div class="block-1" contenteditable="true"> 1st Block </div>
<div class="block-2" contenteditable="true"> 2nd Block </div>
<div class="block-3" contenteditable="true"> 3rd Block </div>
<div class="block-4" contenteditable="true"> 4th Block </div>