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 returntrueorfalseindicate whether element should kept (matches). - the
:eq()selector lets choose index within matched set.
Comments
Post a Comment