title: how to implement search functionality in javascript for phonegap?
body: <p>I want to implement a search functionality in java script.I am new to java script.if i have committed any blunder in the code below forgive me.</p>
  
  <p>How should I implement it?</p>
  
  <p>I tried implementing like this </p>
  
  <p><strong>javascript</strong></p>
  
  <pre><code>$("#input").keyup(function() {
  var userInput = $(this).val();
  $("#list div").map(function(index, value) {
      $(value).toggle($(value).text().toLowerCase().indexOf(userInput) &gt;= 0);
  });
  </code></pre>
  
  <p>});</p>
  
  <p><strong>BUT,CORDOVA EITHER DOES NOT RECOGNIZE $...SO WHEN i IMPLEMENTED IT LIKE THIS</strong> </p>
  
  <pre><code>document.getElementById("input").keyup(function() {
                  var userInput = val();
                  document.getElementById("main div").map(function(index, value) {
                  document.getElementById(value).toggle(document.getElementById(value).text().toLowerCase().indexOf(userInput) &gt;= 0);
  </code></pre>
  
  <p><strong>NOW, I GET an error as</strong> </p>
  
  <pre><code>05-30 11:59:18.500: INFO/Web Console(930): JSCallback Error: TypeError: Result of expression 'document.getElementById("input").keyup' [undefined] is not a function. at file:///android_asset/www/cordova-2.1.0.js:3727
  </code></pre>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;input type="text" id="input"/&gt;
  &lt;div id="list"&gt;
  &lt;div&gt;Rich&lt;/div&gt;
  &lt;div&gt;Rajim&lt;/div&gt;
  &lt;div&gt;vimal&lt;/div&gt;
  &lt;div&gt;RAGHU&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Please,suggest me a solution to work on.</p>