Next looks for nodes of the same level, and children looks for subnodes & lt; div & gt; & lt; ul & gt; & lt; liclass & quot; first & quot; & gt; & lt; ahref & quot; # & quot; & gt; this is Level 1 menu & lt;/a & gt; & lt; ul & gt; & lt; liclass & quot; second & quo next searches for nodes of the same level, and children searches for subnodes.
- This is Level 1 menu 1
- This is Level 2 menu 11
- This is Level 2 menu 12
- This is Level 1 menu 2
- This is Level 2 menu 21
- This is Level 2 menu 22.
The jquery code is as follows:
$ (Document). ready (function (){
$ ("Li. first"). hover (function (){
$ (This). children ("ul"). slideDown (); the ul node indicating the blacklist is found.
},
Function (){
$ (This). children ("ul"). slideUp ();
});
});
If it is changed to $ (this). next ("ul"), it cannot be found because there is no ul node at the same level as it!
From Xu Yue's column