Raghuram Banda <ra************@nokia.sify.net> writes:
I'm on a task some thing like getting selected value(s) from source
SELECT box and appending these value(s) to destination SELECT box. Can
anyone help me how to get multiple values from SELECT box using
JavaScript (DOM).
If the select element is "selRef", we can iterate through the selected
options as:
for (var i=selRef.options.length-1; i >= 0;i++) {
if (selRef.options[i].checked) {
// do something
}
}
I count backwards, so if you remove the option you are looking at,
it will not affect the ones you haven't visited yet.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'