I have list of Items and a search box. if search term entered into the search box the matched text should appear with bold letters in the list irrespective of the case(case insensitive). I have done up to some level but later i dont know how to do it, as i am new to the jquery.
<html>
<head>
<script type="text/javascript"
src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".SearchElement").keyup(function(){
keyword = $(".SearchElement").val();
if(keyword.length>=3){
var content = $(".wrapperbox ul li").text();
test = content.match(/keyword/gi)
if(test){
//alert(test);
}
}
});
});
</script>
</head>
<body>
<form action="">
<label>SearchTerm:</label> <input type="text"
name="SearchBox" value="" class="SearchElement" />
</form>
<div class="wrapperbox">
<ul>
<li>TestString</li>
<li>testString</li>
<li>Kanigiri</li>
<li>KANIGIRI</li>
</ul>
</div>
</body>
</html>
How can i do that, any help will be greatly appriciated. Thank you