JSFiddle - React, Tailwind, and code Playground

HTML

<textarea id="foo" value=""></textarea><br/>
<input id="bar" value="" type ="text" /><br/>
<input id="check" value="test" type ="button" /><br/>
<span id="res"></span>

JavaScript

$( function(){
    $('#check').on('click', function(){
        $('#res').html( "textarea vide => " +$("#foo[value='']").length + "<br/>input vide => " + $("#bar[value='']").length);
    });

})