I have an unordered list structured like this:
<ul>
<li id="projectrow_364">
<span>Forest</span>
</li>
<li id="projectrow_365">
<span>Life</span>
</li>
<li id="projectrow_367">
<span>House</span>
</li>
<li id="projectrow_388"> Country
<ul>
<li id="projectrow_390">
<span>US</span>
</li>
</ul>
</li>
On the same page, I also have:
<h3 id="project-title-id"> US</h3>
How can I use jQuery to add the class name "activeProject
" to the <ul> li
element above where the text of #project-title-id matches with the text value of <ul> <li>
?