JSFiddle - React, Tailwind, and code Playground

HTML

<div class="post" placeholder="Write a comment..." contenteditable="true"></div>
<button class="clr">clear</button>

CSS

[contenteditable=true]:empty::before {
  content: attr(placeholder);
}

JavaScript

$('.clr').click(function(){$('.post').empty()})