Question: I want to get the value of the selected option from a dropdown list, in D3.js. 

```
<select>
<option data-graph="1">1</option>
<option value="2">2</option>
</select>

```

I have seen [this question](https://stackoverflow.com/questions/11903709/adding-drop-down-menu-using-d3-js) which explains how to get the value when the select changes: 

```
d3.select("#myselect").on("change", change)
function change() {
    this.options[this.selectedIndex].value
}

```

But how can I get the selected value on page load, not when the select is changed?

Answer: 
Use the [`.property()` method](https://github.com/mbostock/d3/wiki/Selections#property):

```
d3.select("#objectID").property("value")

```
I've also seen 

```
d3.select("#objectID")[0][0].value

```

But I'm quite sure this is generally a bad idea...