I would like to set the value of a select-menu option to a value of a JavaScript object.
HTML
<select id="eRedList">
<option value=electroSeries.Li.potential>Li</option>
</select>
JS
var electroSeries = {
Li: {name : "Li", charge : "1", potential : -3.05, redReaction : "Li+(aq) + e- >> Li(s)", oxReaction : "Li(s) >> Li+(aq) + e-"};
}
so here, I want to the value associated with the property 'potential' to the HTML value. However, when I try to display this in a text box just to see what I get, I end up getting 'electroSeries.Li.potential' written instead of the numerical value.
I'm relatively new to JS, so any help would be appreciated!