Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <input type="text"/>
  <button>find</button>
  <ul>
    <li>Krish</li>
    <li>Krish</li>
    <li>Krish</li>
    <li>LastOne</li>
  </ul>
</body>
</html>
 
var li = $('ul li'),
    input = $('input');
$('button').on('click', function(){
   var search = input.val(), regex;
   li.removeClass('highlight');
   if(search){
      regex = new RegExp(search, 'i')  
      li.filter(function(){ 
        return $(this).text().match(regex);
      }).addClass('highlight'); 
    }
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers