Click here to Skip to main content
15,306,245 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
example:
fruits
mango
apple
sports
tennis
cricket
Posted
Comments
Afzaal Ahmad Zeeshan 27-Nov-14 11:43am
   
.. and what is the purpose of this question?

Please use the "Improve question" to add more details to this question, because as it stands this text is not even HTML and is just a text.
Zoltán Zörgő 30-Nov-14 7:52am
   
Any progress? If you have found my answer of use, feel free to accept it!

1 solution

You mean something like this?

HTML
<html>
<head>
	<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
	<script>
	function find(text){
		$('li').filter(function() {
			return $(this).text() == text;
		}).css("background-color", "red");
	}
	</script>
	<style>
	</style>
</head>
<body>
<ul>
<li>
Fruits
<ol>
<li>Apple</li>
<li>Grape</li>
</ol>
</li>
<li>
Sports
<ol>
<li>Cricket</li>
<li>Tennis</li>
</ol>
</li>
</ul>
<button onclick="find('Grape');">find Grape</button>
</body>
</html>
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900