title: HTML <select> and <option> conditional tag
body: <p>I am creating an online form that allows a user to enter a business client into a database- nothing complicated. Depending on the answer selected for the first question (the country), a consequent dropdown should appear prompting the user to select a Province/State, followed by yet another dropdown prompting the user to select a city within that Province/State. </p>
  
  <p>So far, none of the conditioning works. The first question displays a dropdown for the country selection, but selecting any option does not prompt any additional questions.</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;script&gt;
      
      function displayCountry(answer) {
        document.getElementById(answer).style.display = "block";
        if (answer == "China") { 
          document.getElementById("India").style.display = "none";
          document.getElementById("USA").style.display = "none"; }
        else if (answer == "India") {
          document.getElementById("China").style.display = "none";
          document.getElementById(USA).style.display = "none"; }
        else if (answer == "USA") {
          document.getElementById("China").style.display = "none";
          document.getElementById("India").style.display = "none"; }
      }
      
      function displayProvince(answer) {
        document.getElementById(answer).style.display = "block";
        if (answer == "Beijing Municipality") { 
          document.getElementById("Tianjin Municipality").style.display = "none"; }
      
        else if (answer == "Tianjin Municipality") {
          document.getElementById("Beijing Municipality").style.display = "none"; }
      }
      
      function displayChinaCity(answer) {
        document.getElementById(answer).style.display = "block";
        if (answer == "Beijing") { 
          document.getElementById("Dongcheng").style.display = "none"; }
      
        else if (answer == "Dongcheng") {
          document.getElementById("Beijing").style.display = "none"; }
      }
      
      &lt;/script&gt;
       
       &lt;!-- ############################################################################--&gt;
      
      &lt;div class="container"&gt;
          &lt;h3&gt;Add Client&lt;/h3&gt;  
              &lt;div class="tab-content"&gt;         
                  &lt;form action="/add/clients" method="post"&gt;
              &lt;!-- ################################ Client ID ################################--&gt;
                    &lt;div class="top-row"&gt;
                      &lt;div class="field-wrap"&gt;
                      &lt;label&gt;
                        Client ID&lt;span class="req"&gt;*&lt;/span&gt;
                        &lt;input&gt;
                      &lt;/label&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
        &lt;!-- ################################ Client name #############################--&gt;
                    &lt;div class="top-row"&gt;
                      &lt;div class="field-wrap"&gt;
                      &lt;label&gt;
                        Client name&lt;span class="req"&gt;*&lt;/span&gt;
                        &lt;input&gt;
                      &lt;/label&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
      
          &lt;!-- ############################## Client type ##############################--&gt;
                    &lt;div class="field-wrap"&gt;
                      &lt;label&gt;
                        Client type&lt;span class= "req"&gt;*&lt;/span&gt;
                      &lt;select&gt;
                      &lt;!--Removed for simplicity --&gt;
                      &lt;/select&gt;&lt;/label&gt;
                    &lt;/div&gt;             
          &lt;!-- ########################### Client location #############################--&gt;
                    &lt;div class="field-wrap"&gt;
                      &lt;form name="feedback" action= "javascript:void(0)"&gt;
                        &lt;label&gt;Client Origin&lt;span class="req"&gt;*&lt;/span&gt;
                          &lt;select name= "country"&gt;
                            &lt;option selected= "--"&gt;--&lt;/option&gt;
                            &lt;option value= "China" onchange= "displayCountry(this.value)" value= "China"&gt;China&lt;/option&gt;
                            &lt;option value= "India" onchange= "displayCountry(this.value)" value= "India"&gt;India&lt;/option&gt;
                            &lt;option value= "USA" onchange= "displayCountry(this.value)" value= "USA"&gt;USA&lt;/option&gt;
                          &lt;/select&gt;
                        &lt;/label&gt;
      
                        &lt;div id= "China" style= "display:none;"&gt;&lt;br/&gt;
                          Select Province&lt;span class="req"&gt;*&lt;/span&gt;
                          &lt;select name= "province"&gt;
                            &lt;option selected= "--"&gt;--&lt;/option&gt;
                            &lt;option value= "Beijing Municipality" onchange= "displayProvince(this.value)" value= "Beijing Municipality"&gt;Beijing Municipality&gt;&lt;/option&gt;
                            &lt;option value= "Tianjin Municipality" onchange= "displayProvince(this.value)" value= "Tianjin Municipality"&gt;Tianjin Municipality&gt;&lt;/option&gt;
                            &lt;!--More options removed for simplicity --&gt;
      
                          &lt;/select&gt;
                        &lt;/div&gt;
                        &lt;div id= "Beijing Municipality" style= "display:none;"&gt;&lt;br/&gt;
                          Select City&lt;span class="req"&gt;*&lt;/span&gt;
                          &lt;select name= "city"&gt;
                            &lt;option selected= "--"&gt;--&lt;/option&gt;
                            &lt;option value= "Beijing" onchange= "displayChinaCity(this.value)" value= "Beijing"&gt;Beijing&lt;/option&gt;
                            &lt;option value= "Dongcheng" onchange= "displayChinaCity(this.value)" value= "Dongcheng"&gt;Dongcheng&lt;/option&gt;
                            &lt;!--More options removed for simplicity--&gt;
                          &lt;/select&gt;
                        &lt;/div&gt;
                        &lt;!--divs for other cities,provinces,and countries omitted for simplicity--&gt;
                      &lt;/form&gt;
                    &lt;/div&gt; 
            &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>