title: change submit button name based on selected dropdown list
body: <p>How to change the button's name based on the selected values?  This function I found returns <code>null</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 myFunction(new_id) {
    if (new_id == 0) {
      return;
    }
    document.getElementById("submit").id = new_id;
  
    // test new id
    // remove this after testing
    alert(document.getElementById(new_id).id);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select id="select" name="select" class="btn btn-block gray dropdown-toggle" required onchange="myFunction(this.value)"&gt;
    &lt;option Disabled value="0" selected="selected"&gt;- Select Me -&lt;/option&gt;
    &lt;option value="5"&gt; 5&lt;/option&gt;
    &lt;option value="10"&gt; 10&lt;/option&gt;
  &lt;/select&gt;
  &lt;button type="submit" id="submit" name=""&gt;Button&lt;/button&gt;&lt;br&gt;</code></pre>
  </div>
  </div>
  </p>