title: Call a custom function based on selected select field option
body: <p>I got a problem with this code below.</p>
  <p>I want to choose between 2 options. When i choose <code>&quot;1&quot;</code>, then <code>F1()</code> is called. When choose <code>&quot;2&quot;</code>, then <code>F2()</code> is called.</p>
  <p>Unfortunately something is wrong with my code.</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-js lang-js prettyprint-override"><code>function abc(element){
      var value1 = element.options[element.selectedIndex].value;
      
      switch(value1){
          case 1:
              F1();
              break;
          case 2:
              F2();
              break;
      }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select id = "nextGeneration" onchange="abc(this)" &gt;
     &lt;option value="1"&gt;1&lt;/option&gt;
     &lt;option value="2"&gt;2&lt;/option&gt;
  &lt;/select&gt; </code></pre>
  </div>
  </div>
  </p>