Node.js examples for HTML:Select Option
Select all options in a multi-valued <select>
function selectAll(elementId) { var element = document.getElementById(elementId); len = element.length;/*from w w w.j a v a 2 s.c om*/ if (len != 0) { for (i = 0; i < len; i++) { element.options[i].selected = true; } } }