Kenneth B Kenneth B - 1 year ago 149
jQuery Question

jQuery: Direct child of $(this)

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

I have:

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

And need it to act like this:

obj > "ul"

Is it possible?

Answer Source

$(this).children('ul') returns a list of direct children.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download