How to filter/search text from div with jquery for upper- and lowercase?
/--------- Source--------/
<p>
<label for="search">Search from here:</label>
<input id="searchme" name="search" type="text" />
</p>
<div id="searchID">
<ul>
<li><strong>Name :</strong> Akash Sathvara</li>
<li><strong>Profession :</strong> Web Developer</li>
<li><strong>Expert in :</strong>Php, Codeigniter, Laravel, Wordpress, Mysql, Mssql, Javascript</li>
<li><strong>I'M web developer in Ahmedabad,Gujarat -INDIA</strong></li>
<li><strong>This is a simple demo for searching a text from div using jquery.Hope this will help you. Thank you.</strong></li>
</ul>
</div>
/--------- jquery --------/
<script>$('#searchme').keyup(function(){
var text = $(this).val();
var value = text.toUpperCase();
$("#searchID > ul > li").each(function() {
if ($(this).text().toUpperCase().search(value) > -1) {
$(this).show();
}
else {
$(this).hide();
}
});
});
</script>
Comments
Post a Comment