简体   繁体   English

在Tritium中,可以选择节点的所有子级吗?

[英]In Tritium, can I select all children of a node?

I have a div that has several child divs. 我有一个具有多个子div的div。 Some have ID's and classes, some do not. 有些具有ID和类,有些则没有。

I have used move_children_to() and was wondering if there is something similar to select the children. 我使用过move_children_to(),想知道是否有一些选择子项的方法。

There are a few different ways to select the immediate children. 有几种不同的方法选择直系子代。

First you can do: 首先,您可以执行以下操作:

$("./*") {
  # code for children goes here.
}
move_children_to("..", "after)

Another way to handle this would be to just open a scope on move_children_to() 解决此问题的另一种方法是只在move_children_to()上打开一个作用域

move_children_to("..", "after) {
  # children code can go here.
}

I hope this helps! 我希望这有帮助! Let me know if I can provide any more assistance. 让我知道是否能提供更多帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM