Is it possible to apply a class to the paragraph tag only if the subsequent tags are an unordered list?
Here is an example of the markup:
<p>paragraph</p>
<p>paragraph 2</p>
<ul>
<li>line 1</li>
</ul>
In this scenario, the first paragraph tag does not have any class applied to it. However, the second paragraph tag would be assigned the class 'foo' because the following element is an unordered list.