How to bulk select <td> using jQuery
I have an HTML table with many rows. I have seven columns. Each cell ( <td>) in the table has an ID attribute with a grid of [x] [y], where x and y represent columns and rows, respectively.
An example <td>:
<td id="grid[2][2]" class="available"...> -- This indicates 3rd column 3rd row
<td id="grid[2][4]" class="unavailable"...> -- This indicates 3rd column 5th row
etc.
Now I need to write a query that gives me the number of columns with class = "available" or class = "unavailable". How to write it in jQuery?
So, to get the first column with class = "available" it will be something like this,
(id = grid[0]* and class == "available").size
Help me convert the above (stupid query) into full jQuery.
+3