JSFiddle - React, Tailwind, and code Playground
by willystyle
HTML
<div class="root" contenteditable="true">
<p id="block-0">I do not want to prevent this paragraph from delete.</p>
<p id="block-1">I want to prevent this paragraph from delete.</p>
<p id="block-2">I do not want to prevent this paragraph from delete.</p>
</div>
CSS
.root {
max-width: 700px;
margin: 1rem auto;
border: 1px solid;
}
JavaScript
let immutableP = document.getElementById('block-1');
immutableP.setAttribute("contenteditable", false);