title: how to make auto input in textfield html
body: <p>When I select one of the choice in the datalist, I want the textfield to be auto filled. I have this code but it does not work. Sorry my English is not good</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td width="15%"&gt;&lt;div class="tabtxt"&gt;Pilih Pembayaran&lt;/div&gt;&lt;/td&gt;
      &lt;td width="2%"&gt;&lt;div class="tabtxt"&gt;:&lt;/div&gt;&lt;/td&gt;
      &lt;td width="83%"&gt;
          &lt;input list="bayar" name="bayar" style="width: 203px"&gt;
          &lt;datalist id="bayar"&gt;
              &lt;option value="Visual Basic Islam"&gt;
              &lt;option value="Baitul Arqam"&gt;
              &lt;option value="Shortcourse"&gt;
              &lt;option value="Sertifikasi"&gt;
              &lt;option value="Seminar SID"&gt;
              &lt;option value="TOEFL &amp; Bahasa Inggris"&gt;
          &lt;/datalist&gt;
     &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td width="15%"&gt;&lt;div class="tabtxt"&gt;Kode Pembayaran&lt;/div&gt;&lt;/td&gt;
      &lt;td width="2%"&gt;&lt;div class="tabtxt"&gt;:&lt;/div&gt;&lt;/td&gt;
      &lt;td width="83%"&gt;
          &lt;input name="id_bayar" style="width: 200px" type="text" class="tfield" id="id_bayar"&gt;
          &lt;script type="text/javascript"&gt;
              $("#bayar").change(function(){
                  var in = $("#bayar").val();
                  $("id_bayar").val("hallo");
              });
          &lt;/script&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>How do I solve this? Thanks for the answers</p>