Adding String to this in jQuery

If this is an HTMLDivElement, how do I avoid doing this ?

$('#' + $(this).id + " > p").foo();

to do something like :

($(this) + $( " > p")).foo();

Answers


$(this).children('p').foo();

Try this:

$(this).find("> p").foo();

Need Your Help

GPU or hardware-based h.264 encoder with API?

video video-streaming video-encoding h.264 html5-video

We'd like to stream h.264 video to a browser based on frames generated on the server. The frames would be synthetic, i.e. not coming from another "real movie", mpeg, etc. We'd be generating them