JQuery $(this) selector function and limitations

后端 未结 5 1152
南方客
南方客 2020-12-01 08:31

I need help understanding $(this). Is it possible to narrow the focus of \'this\' within the parentheses or does \"this\" preclude the use of any other attributes?

5条回答
  •  情歌与酒
    2020-12-01 09:16

    First, you must to understand what is this, it is depend on an context. When you call $ function it will return a jQuery object.

    $(this).children("div")
    

    It means from specific object, get all children, see the below link: http://jsfiddle.net/vietean/f2Yrg/

提交回复
热议问题