How to change input type according to the option value?
<p>I'm trying to change the input type according to the option value. </p>

<p>If the date option is selected, the type of input field should be changed into date type.</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>function func2() {
  if (document.getElementById('field_search').value=="khao_date") {
    document.getElementById('input_search').type == 'date';
  }
  else {
    document.getElementById('input_search').type == 'text';
  }
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select id="field_search" name="field_search" size=1 onchange="func2()"&gt;
  &lt;option value="khao_date"&gt;Date&lt;/option&gt;
  &lt;option value="khao_detail"&gt;Detail&lt;/option&gt;
&lt;/select&gt;

&lt;input id="input_search" type="text"&gt;</code></pre>
</div>
</div>
</p>

<p>but somehow it doesn't change. Can someone help me?
Thanks in advance!</p>