I have an HTML table where each row represents a company and each column represents a year.
Returning a collection of all the cells in a row will be easy. I could give the row an ID or class and look for all the <td> elements within that row. But how would I get all the elements that correspond to a particular year (column)?
I was thinking I could make up element IDs using the company and year values (e.g. item_1234_2011). This would make it possible, given an element's ID, to determine that elements corresponding company and year IDs. But how would I locate all the elements associated with a given year?
Doing something like this $('td[id$=_2011]'); comes to mind, if you use the format you specified.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With