I'm trying to apply CSS to HTML elements that have specific HTML within them using Javascript/jQuery. What I've got is basically:
<ol>
<li>*<a href=http://foo.com/1>A bunch of text</a>
<li><a href=http://foo.com/2>More text</a>
<li>*<a href=http://foo.com/3>Even more text</a>
<li><a href=http://foo.com/4>Just a little more text</a>
</ol>
What I want is to run .addClass() on the two <li> tags that are followed by an asterisk.
I know I could use $("ol li:contains(*)") but there could be asterisks in the link text, so I can't trust that to be 100% accurate. Ideally, I'd like to find a way to run .addClass() on all <li> tags that are followed by *<a href=http://foo.com/, but just a way to run it on <li> followed by * would probably do it.
I looked at the answer to this question, but it doesn't help, even if I switched out innerText for innerHTML, because I'm not looking to match the whole HTML of the <li>, just the beginning.
</li>tags.