Jquery finding the first P


I have the following:


where content =


What I want to happen is to find the first PARAGRAPH tag, whether it be at the top or down a child level or more of a div. How can I tell jQuery to find the first

tags all the way down until the first match?


Best Solution

You can use .find() to get any level decendant, like this


If it may be the top level, it's not as clear, you need to do .filter() and .find()...but the results are in order, so still take the first, like this: