Javascript jquery循环问题
我在页面上给定的每个循环中。我如何在$this内循环所有,即在当前: 但是,如果您不需要在tr上执行任何操作,或者可以链接它们,则可以更简洁地执行此操作Javascript jquery循环问题,javascript,jquery,dom,Javascript,Jquery,Dom,我在页面上给定的每个循环中。我如何在$this内循环所有,即在当前: 但是,如果您不需要在tr上执行任何操作,或者可以链接它们,则可以更简洁地执行此操作 $(this).find('th').each(...) 或 您可以在原始循环中执行此操作: $('#my_table > tbody > tr > th').each(function() { 但是,如果由于某种原因无法执行此操作,例如循环中存在其他代码,则可以使用以下方法: $('th',this).each(func
$(this).find('th').each(...)
或
您可以在原始循环中执行此操作:
$('#my_table > tbody > tr > th').each(function() {
但是,如果由于某种原因无法执行此操作,例如循环中存在其他代码,则可以使用以下方法:
$('th',this).each(function() {
过滤器将从当前选择器中删除任何不是th的元素,而不是获取th的子元素
$(this).find('th').each(...)
$('th', this).each(...)
$('#my_table > tbody > tr > th').each(function() {
$('th',this).each(function() {