JSFiddle - React, Tailwind, and code Playground

HTML

<table>
        <tbody>
            <tr>
                <td>1</td>
                <td>2</td>
            </tr>
            <tr>
                <td colspan="2">3</td>
            </tr>
        </tbody>
    </table>

JavaScript

console.log($('td').not(':has([colspan])'))
alert($('tr').not('td').has('[colspan]').length)