JSFiddle - React, Tailwind, and code Playground

by tryandls

HTML

<div id="foo"></div>
<div id="bar" class=""></div>

JavaScript

console.log($('#foo').attr('class') === undefined ? 'undef' : 'blank')
console.log($('#bar').attr('class') === undefined ? 'undef' : 'blank')