JSFiddle - React, Tailwind, and code Playground

HTML

<html>
    <head>
    </head>
    <body>
<form name="f" id="f">
    <input name="f1" type="text" value="" /> <br/>
    <input name="f2" type="text" value="" /> <br/>
    <input name="f3" type="text" value="" /> <br/>
</form>
        <a href="#" onclick="countEmpty(); return false;">count empty</a>
</body>
</html>

JavaScript

function countEmpty()
{
    alert($('#f').find('input[value=""]').length);
}