How can I select all the items in a multiple select box in JavaScript?
Printable View
How can I select all the items in a multiple select box in JavaScript?
I think this should work with sel being the select:
But it's only a guess.Code:for(var i = 0; i < sel.options.length; ++i) {
sel.options[i].selected = true;
}