title: how to make String Case Insensitive in Java Script String Case Insensitive Function
body: <p>I am searching the data entered by user from array it is working fine but it is case sensitive i want to remove this casesensitive </p>
  
  <pre><code>    else if(document.getElementById('drop_down_list_1').value=="Beef"){
      if(document.getElementById('search_input').value==""){
      alert("Please Enter a charactor / word..");
       return false;
      }
      else{
      var con = document.getElementById('first_div');
      var con2 = document.getElementById('first_div2');
      var char = document.getElementById('search_input').value;
      var str = '';
      var j = 0;
      var ad = ['CLARIFIDE Deadlines 2012 - 2013 Nov','C','REPRODUCTIVE VACCINES — REPRODUCTIVE CLAIMS','M','M', 'R'];
     var len = ad.length;
     //var break_line = '&lt;br&gt;';
     for (j=0; j&lt;len; j++) {
     var str = ad[j];
     var n=str.indexOf(char);
      if (n == 0)
      con.innerHTML += '&lt;table id="results" width="920" border="1" style="margin:-30px 0 0 -10px;"&gt;      &lt;tr&gt;&lt;td&gt;'
            + str
             + '&lt;/td&gt;&lt;td colspan="4" align="right"&gt;&lt;a href="presenter.command(\'viewPdf\',  {\'path\':%20\'/images/pdf/Beef/'+j+'.pdf\'});"&gt;&lt;img src="images/view.png" style="margin-left:250px;"&gt;   &lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img src="images/email.png"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td colspan="4" align="right"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td colspan="4" align="right"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td colspan="4" align="right"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td colspan="4" align="right"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td colspan="4" align="right"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;'
          //+ break_line;
          //break_line = '&lt;br&gt;';
     }
    }
    }
  </code></pre>
  
  <p>so how to make the search case insensitive.</p>