title: How to Change data based on key press
body: <p>I want to show the values in the array on the page and give a input box to take keyword as input and based on the filtering, i want to change the content...</p>
  
  <p>here is the code</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  
  &lt;head&gt;
          &lt;meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /&gt;
          &lt;meta name="author" content="Ahmet YUCEL" /&gt;
      &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"&gt;&lt;/script&gt;
  &lt;title&gt;Untitled 2&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;input type="text" id="input_element_id" name="input_element_id"/&gt;
  &lt;?php
  $all_elms=array("439399343"=&gt;"Anshul Singhal","3439493943"=&gt;"Mayank","343949398438"=&gt;"ankit","34839849839"=&gt;"shivank","3843884384"=&gt;"dheeraj","383849839"=&gt;"sparrow","8348399219"=&gt;"makar makru","43891928382"=&gt;"lying dehhhee");
  echo json_encode($all_elms);
  ?&gt;
  
  &lt;div id="user"&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  
  &lt;script type="text/javascript"&gt;
  $('#input_element_id').keydown(function() {
          val = $(this).val();
          $(all_elms).each(function(){
                  if(this.search(val) &gt;= -1) $("#user-" + this).show();  
          });    
  });
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>