JSFiddle - React, Tailwind, and code Playground

HTML

<table class="ms-unselectedtitle">
<tr>
    <td class="ms-vb-title"><table class="ms-unselectedtitle" id="foo"></table></td>
</tr>
</table>

JavaScript

// filter out all tables with immediate parent td.ms-vb-title
// returns a collection
var ids = $('.ms-unselectedtitle').filter(function() {
    return $(this).parent('td').hasClass('ms-vb-title');

// from resulting collection, grab all IDs
}).map(function() {
    return this.id;

// convert to array
}).get();
alert(ids);