JSFiddle - React, Tailwind, and code Playground

HTML

<div>
            <ul>
                <li id='one'>number</li>
                <li id='two'>othernumber</li>
            </ul>
        </div>
        <div>
            <table>
                <thead>
                    <tr>
                        <th>title</th><th>title</th><th>title</th><th>title</th>
                    </tr>
                </thead>
                <tbody id="table1">
                    <tr>
                        <td>blah</td>
                        <td>blah</td>
                        <td>blah</td>
                        <td>blah</td>
                    </tr>
                   
                </tbody>
                <tbody id="table2" style="display:none">
                    <tr>
                        <td>blahTwo</td>
                        <td>blahTwo</td>
                        <td>blahTwo</td>
                        <td>blahTwo</td>
                    </tr>
                </tbody>
            </table>
        </div>

JavaScript

function count(){
    var list = jQuery('ul li')
    console.log(list.length)
    for(var y = 1; y <= list.length; y++){
        return y
    }
    var table = jQuery('table tbody')
    console.log(table.length)
    for(var i = 1; i <= table.length; i++){
        return i
    }
    if(i == y){
        jQuery(list).click(function(){
            //show the table length that is equal to the list length 
            
        })
    }
}