1]'); The a...">All geek questions in one placeChoose td elemensts with colspanHow can I get all td elements with "colspan" greater than 1 in jQuery?var nodes = $('td[colspan>1]'); The above code does not work.+6jquery domErik Jun 19 '12 at 7:15source share3 answersSince there is no colspan = 0, you can just do $('td[colspan]').not('[colspan=1]') +8Thomas Jun 19 '12 at 7:21source shareUse filter : var nodes = $('td[colspan]').filter(function() { return +$(this).attr('colspan') > 1 }); + , added to $(this).attr('colspan') , converts a string to a number+6fcalderan Jun 19 '12 at 7:17source share var tds = $('td').each(function(){ if($(this).attr('colspan') > 1){ return $(this); } }) +2Arvind bhardwaj Jun 19 '12 at 7:21source shareSource: https://habr.com/ru/post/918438/More articles:Using firefox default profile with selenium webdriver in python - pythonHow to write functionality using DDD / CQRS - c #no route matches for assets / images in Rails - asset-pipelinehttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/918436/perl-how-can-i-get-emacs-to-add-quotes-to-full-path-of-a-perl-script&usg=ALkJrhjZ_1TwTodoAfPh4TYPx21Ii_s98gI need to select a specific column based on a list of checkboxes - c #Castle WCF Container Configuration - c #Which of these examples represent the correct use of DDD? - c #Implementing Dynamic LINQ Queries in an MVC5 / EF Application? - c #What is the difference between OCMock's wait methods and stubs? - unit-testingThumbnails Nivo Slider do not display properly in IE - internet-explorerAll Articles
How can I get all td elements with "colspan" greater than 1 in jQuery?
var nodes = $('td[colspan>1]');
The above code does not work.
Since there is no colspan = 0, you can just do
$('td[colspan]').not('[colspan=1]')
Use filter :
var nodes = $('td[colspan]').filter(function() { return +$(this).attr('colspan') > 1 });
+ , added to $(this).attr('colspan') , converts a string to a number
+
$(this).attr('colspan')
var tds = $('td').each(function(){ if($(this).attr('colspan') > 1){ return $(this); } })
Source: https://habr.com/ru/post/918438/More articles:Using firefox default profile with selenium webdriver in python - pythonHow to write functionality using DDD / CQRS - c #no route matches for assets / images in Rails - asset-pipelinehttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/918436/perl-how-can-i-get-emacs-to-add-quotes-to-full-path-of-a-perl-script&usg=ALkJrhjZ_1TwTodoAfPh4TYPx21Ii_s98gI need to select a specific column based on a list of checkboxes - c #Castle WCF Container Configuration - c #Which of these examples represent the correct use of DDD? - c #Implementing Dynamic LINQ Queries in an MVC5 / EF Application? - c #What is the difference between OCMock's wait methods and stubs? - unit-testingThumbnails Nivo Slider do not display properly in IE - internet-explorerAll Articles