HTML Select Multiple in Javascript

From Code Trash
Jump to: navigation, search

HTML Select element Multiple select manipulation in Javscript

selected = new Array();
for (var i = 0; i < ob.options.length; i++)
if (ob.options[ i ].selected)
selected.push(ob.options[ i ].value);