For example I have a list like this
<ul id='root'>
<li> <a> Item0 </a> </li>
<li> <a> Item1 </a> </li>
<li>
<a> Item2X </a>
<ul>
<li> <a> Item2.0 </a> </li>
</ul>
</li>
</ul>
and want to check if root contains the following item
<li> <a> Item2.0</a> </li>
We can use jquery the text value of a list item to compare for easiness. What is a good way to solve the above problem?
Use jQuery contains: