jQuery: Direct child of $(this)

前端 未结 5 1525
你的背包
你的背包 2021-02-11 20:12

Is it possible to, somehow, select a direct child of $(this)?

I have:

var obj = $(this);  
$(\"ul\", obj).css(\'width\',s*w);

And need

5条回答
  •  情深已故
    2021-02-11 20:59

    this may work too (depends on what exact situation are you in maybe)

    $(this).find('>*:eq(0)')
    

提交回复
热议问题