Make input fields case insensitive in JavaScript
<p>I have a problem with my code, namely:  If in input <code>#search_code</code> I introduce letter 'm' and in <code>#insert_code</code> input I introduce letter "M", function returns "is not ok".  I tried to make uppercase inputs with CSS <code>text-transform: uppercase;</code> but it does not work.  What can we do to make input fields case insensitive?</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var search_code = document.getElementById('search_code');
var insert_code = document.getElementById('insert_code');
var result = document.getElementById('result');
var button = document.getElementById('button');
var audio = new Audio('sound.wav');


// respond to button click
button.onclick = function validate(e) {
  e.preventDefault();
  
  // show verification result:
  if (search_code.value == insert_code.value) {
    result.textContent = 'code ok';
    result.className = "ok";
    audio.play();
  } else {
    result.textContent = 'code is not ok';
    result.className = "not-ok";
  }
  // clear input when wrong:
  if (search_code.value !== insert_code.value) {
    insert_code.value = '';
  }
  return false;
};

function clearField(input) {
  input.value = "";
};

$(document).ready(function(){
      $('#search_code').bind("cut copy paste",function(e) {
          e.preventDefault();
      });
    });</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>...
     &lt;form&gt;
        &lt;input type="text" name="search_code" onfocus="clearField(this, this.placeholder='');" onblur="this.placeholder='introdu codul'" id="search_code" placeholder="introdu codul" autocomplete="off" value=""/&gt;&lt;br/&gt;
        &lt;input type="" name="insert_code" onfocus="clearField(this, this.placeholder='');" onblur="this.placeholder='scaneaza codul'" id="insert_code" placeholder="scaneaza codul" autocomplete="off" value=""/&gt;&lt;br/&gt;&lt;br/&gt;
        &lt;input type="submit" id="button" name="button" value="verifica COD" /&gt;
    &lt;/form&gt;

    &lt;/div&gt;
  &lt;div id="result"&gt;&lt;/div&gt;
   &lt;/div&gt;
   &lt;script src="js/action_input.js"&gt;&lt;/script&gt;
 &lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
</div>
</p>