title: how to manipulate onchange ajax?
body: <p>I have a form where when I select the select option in the input (jurusan) it is also filled in based on the value. Here I want to change the value of the value obtained by selecting the option, how do I do it?</p>
  <p>Suppose I select select A will appear 1</p>
  <p>So how do you change the number 1 to another value? suppose I want to turn it into a car.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Latihan Ajax&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h2&gt;Latihan Ajax 1&lt;/h2&gt;
  
      &lt;select id="nama" name="fakultas" onchange="fakultas()"&gt;
          &lt;option value="0"&gt;-Pilih-&lt;/option&gt;
          &lt;option value="1"&gt;A&lt;/option&gt;
          &lt;option value="2"&gt;B&lt;/option&gt;
          &lt;option value="3"&gt;C&lt;/option&gt;
          &lt;option value="4"&gt;D&lt;/option&gt;
      &lt;/select&gt;
  
      &lt;input type="text" name="jurusan" id="jurusan"&gt;
      &lt;script type="text/javascript"&gt;
          function fakultas(){
              var data = document.getElementById("nama").value;
              document.getElementById("jurusan").value = data;
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>