Similar question to Can an Option in a Select tag carry multiple values? - except I want to reference the values in JavaScript
To recap:
I want to return more than one value for a selected item in a selectbox - so I was thinking something like this:
<SELECT id='selectList'>
<OPTION value1="a" value2="b" value3="c">OPTION 1</OPTION>
<OPTION value1="d" value2="e" value3="f">OPTION 2</OPTION>
</SELECT>
I then want to get the values of the selected item:
var sel = document.getElementById('selectList');
selValue1 = sel.options(sel.selectedIndex).value1;
selValue2 = sel.options(sel.selectedIndex).value2;
selValue3 = sel.options(sel.selectedIndex).value3;
currently I can pull value='x' for an option but I need more values to be associated with the option. I could probably delimit all three values into one and later use string functions to split them out, but that just seem nasty.