JSFiddle - React, Tailwind, and code Playground
by stvnmntjy
HTML
<p id="empty"></p>
<p id="empty_quote"></p>
<p>Is an empty paragraph equal to a paragraph with ''? <span id="answer"></span>.</p>
JavaScript
var $empty = $('#empty');
var $empty_quote = $('#empty_quote');
var $answer = $('#answer');
// first insert '' into empty_quote
$empty_quote.text('');
// and compare their text node contents
var compare = $empty.text() === $empty_quote.text();
$answer.text(compare ? 'Yes': 'No');