<table>
<tbody>
<tr>
<td>
<table>
<tbody>
<tr class="s">
<td class="d"><div id="L_20">0</div></td>
<td class="d"><div> </div></td>
<td class="d"><div> </div></td>
</tr>
<tr class="s">
<td class="d"><div> </div></td>
<td class="d"><div id="L_21">1</div></td>
<td class="d"><div id="L_22">2</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
$("tr.s>td.d>div[id^='L_']").each(function(i,dom){
var idValue = $(dom).attr('id');
console.log(idValue);
});