JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" autofocus="autofocus">

<p id="target"></p>

<script>
    $(function(){
        $("#target").text( $("input[autofocus]").length );
    });
</script>