what does this mean: “jQuery('> li', this)”

前端 未结 6 452
慢半拍i
慢半拍i 2021-01-13 01:38

I\'m trying to figure out how this jQuery plugin works: http://codeasily.com/jquery/multi-column-list-with-jquery

In the plugin there is this line at the beginning:<

6条回答
  •  独厮守ぢ
    2021-01-13 02:16

    its jsut like ul > li except that in this case you are replacing the ul part with the current context which is this. So whatever this is in the scope of that call that is the element you are resolving the > li to.

    So for example:

    var ele = $('ul#someId');
    var list = $('> li', ele);
    
    
    var list2 = $('ul#someId > li');
    
    // list is the same as list2
    

提交回复
热议问题