JSFiddle - React, Tailwind, and code Playground

by serio

HTML

<div>
    here is some html
</div>
<div>
    here is some html
</div>
<div>
    here is some html
</div>
<div>
    here is some html
</div>
<div>
    here is some html
    <a href='#'>woot</a>
</div>

JavaScript

$(function() {
    var myDIV = $('div');
    myDIV.each(function(i) {
        console.log(i);
        if ($(this).find('a').length) {
            console.log('this one has an href');
        }
        else {
            console.log('this one does not');
        }
    });

    if (!myDIV.is(myDIV.find('a'))) {
        console.log('they are not the same');
    }
});