title: Autocomplete search
body: <p>hi every one i need simple auto suggest code i have tried with  jquery.autocomplete.js am not getting what i need to do
  code :- index.jsp</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
   "http://www.w3.org/TR/html4/loose.dtd"&gt;  
  
   &lt;html&gt;  
  
   &lt;head&gt;  
  
       &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;  
  
       &lt;script type="text/javascript" src="jquery-1.3.2.min.js"&gt;&lt;/script&gt;  
  
       &lt;script type="text/javascript" src="jquery.autocomplete.js"&gt;&lt;/script&gt;  
  
   &lt;/head&gt;  
  
   &lt;body&gt;  
  
       &lt;div style="width: 300px; margin: 50px auto;"&gt;  
  
           &lt;b&gt;Country&lt;/b&gt;   : &lt;input type="text" id="country" name="country" class="input_text"/&gt;  
  
       &lt;/div&gt;  
  
  
  
   &lt;/body&gt;  
  
   &lt;script&gt;  
  
       jQuery(function(){  
  
           $("#country").autocomplete("list.jsp");  
  
       });  
  
   &lt;/script&gt;  
  
  
   &lt;/html&gt; 
  
  
  and list.jsp
  &lt;%@page import="java.util.Iterator"%&gt;  
  
   &lt;%@page import="java.util.List"%&gt;  
  
   &lt;%@page import="java.util.ArrayList"%&gt;  
  
   &lt;%  
  
      String countries[] = {  
  
                               "Afghanistan",  
  
                              "Albania",  
  
                               "Algeria",  
  
                              "Andorra",  
  
                               "Angola",  
  
                               "Antigua and Barbuda",  
  
                               "Argentina",  
  
                               "Armenia",  
  
                               "Yemen",  
  
                               "Zambia",  
  
                               "Zimbabwe" 
  
                               };  
  
  
  
       String query = (String)request.getParameter("q");  
  
       System.out.println("1"+request.getParameterNames().nextElement());  
  
       response.setHeader("Content-Type", "text/html");  
  
       int cnt=1;  
  
       for(int i=0;i&lt;countries.length;i++)  
  
       {  
  
           if(countries[i].toUpperCase().startsWith(query.toUpperCase()))  
  
          {  
  
              out.print(countries[i]+"\n");  
  
               if(cnt&gt;=10)  
                  break;  
  
               cnt++;  
  
           }  
  
       }  
  
   %&gt; 
  </code></pre>
  
  <p>there is one more style.css is there but it is not showing anything while execution
  note all source file is present in same folder please tell me where am lacking</p>