jQuery AND selector -


i have datagrid(asp.net) on page. select rows has word 'foo' in first column , word 'bar' in second column.

i know how first column.

jquery('[id$="datagrid1"] tr td:contains(foo)') 

can please let me know how include condition second column has word 'bar'?

edit: also, how match word exactly? selector contains matches when cell contains word.

selectors far. use .filter() greatest flexibility:

jquery('[id$="datagrid1"] tr').filter(function () {     return $('td:eq(0)', this).text() == 'foo' &&         $('td:eq(1)', this).text() == 'bar'; }); 
  • the .filter() functions iterates through each element , expects return true or false indicate whether element should kept (matches).
  • the :eq() selector lets choose index within matched set.

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -