JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    <textarea>sometext</textarea>
</div>

JavaScript

if ($('textarea').attr('maxlength')) {
    $('textarea').text("This should not show up since textarea has no maxlength attribute. Value is "+ $('textarea').attr('maxlength'));
}