JSFiddle - React, Tailwind, and code Playground

by Nechifor Vasile

HTML

<div class="profile-feed row" id="row1">
    Row 1
    <div class="col-sm-6"> <span>Child1</span></div>
    <div class="col-sm-6"><span>Child2</span></div>
</div>

<hr />
<div class="profile-feed row" id="row2">
    Row 2
    <div class="col-sm-6"> <span>Child1</span></div>
    <div class="col-sm-6">No Child's</div>
</div>
<hr />
<div id="result"></div>

JavaScript

var count = $(".col-sm-6").children().length;
$('#result').append('".col-sm-6" selector return ' + count + ' children\'s<br>');
count = $("#row2 .col-sm-6").children().length;
$('#result').append('"#row2 .col-sm-6" selector return ' + count + ' children\'s<br>');
count = $("#row2 .col-sm-6:first-child").children().length;
$('#result').append('"#row2 .col-sm-6:first-child" selector return ' + count + ' children\'s<br>');
count = $("#row2 .col-sm-6:nth-child(2)").children().length;
$('#result').append('"#row2 .col-sm-6:nth-child(2)" selector return ' + count + ' children\'s');