title: D3.js: get value of selected option?
body: <p>I want to get the value of the selected option from a dropdown list, in D3.js. </p>
  
  <pre><code>&lt;select&gt;
  &lt;option data-graph="1"&gt;1&lt;/option&gt;
  &lt;option value="2"&gt;2&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I have seen <a href="https://stackoverflow.com/questions/11903709/adding-drop-down-menu-using-d3-js">this question</a> which explains how to get the value when the select changes: </p>
  
  <pre><code>d3.select("#myselect").on("change", change)
  function change() {
      this.options[this.selectedIndex].value
  }
  </code></pre>
  
  <p>But how can I get the selected value on page load, not when the select is changed?</p>