The task: to create an array with further access to each element through a loop. On the page there are two tables with identifiers. In each table there are cells with the class "can". The array should consist of cells with the class "can" of the first table. Code example:
<table id="tab1"> <tr> <td class="can"></td> <td class="can"></td> <td></td> </tr> </table> <table id="tab2"> <tr> <td class="can"></td> <td></td> <td class="can"></td> </tr> </table>
Naturally, the tables are much larger, therefore, it is not rational to access each cell via id.
I tried to do this:
var tb13 = new Array(); tb13 = $('#tab1>td[class=can]');
But does not work. Any ideas?