JSFiddle - React, Tailwind, and code Playground

by Siddharth Motwani

HTML

<table>
  <tr id='a'>
    <td id='aa'>Cell A</td>
    <td id='ab'>Cell B</td>
    <td id='ac'>Cell C</td>
  </tr>
  <tr id='b'>
    <td id='ba'>Cell A</td>
    <td id='bb'>Cell B</td>
    <td id='bc'>Cell C</td>
  </tr>
</table>

JavaScript

$(function(){
    var tdIds='';
    $('table #b td').each(function(){
        tdIds=tdIds+$(this).attr('id')+ ',';
    });
    alert(tdIds);
});