I'm trying to find a specific row in a table, where the td value in the first column is the_month and the td value in the second column is the_year.
var the_month = 3,
the_year = 15;
var tableRow = jQuery("td").filter(function() {
return jQuery(this).text() == the_month;
}).siblings().filter(function() {
return jQuery(this).text() == the_year;
}).parent('tr')
This code is almost what I want, but it's looking at every td. How can I limit this to only look for the_month in column 1 and the_year in column 2.
Edit: I understand the lack of clarity now. I have a huge table. I'm trying to find the row where the value of the first column is equal to the variable I created, called the_month, which is a number, and the value of the second column is the_year, which is also a variable I created. These variables are numbers. The code I originally posted keeps finding the value of the_month, let's say the_month = 3, in other columns of the wrong row. So I want to look for a row that has the number 3 in the first column and the number 15 in the second column.