I have a datagrid(asp.net) on my page. I would like to select all rows that has the word ‘foo’ in the first column AND the word ‘bar’ in the second column.
I only know how to do it for the first column.
jQuery('[id$="datagrid1"] tr td:contains(foo)')
Can anyone please let me know how to include the condition for the second column which has the word ‘bar’?
Edit:
Also, how do I match the word exactly? As selector contains matches when the cell contains the word.
Selectors only get you so far. Use
.filter()for greatest flexibility:.filter()functions iterates through each element and expects you to returntrueorfalseto indicate whether the element should be kept (matches).:eq()selector lets you choose an index within the matched set.