I have created a simple dropdown list which is populated from a previous dropdown list.
How do i make all selected?
Mentioned below are the codes for the javascript populating it.
function OnClkAddButtonServer(form)
{
var selObj = document.getElementById('List1');
var selObj2 = document.getElementById('List2');
var i;
var count = selObj2.options.length;
for (i=0;i<selObj.options.length;i++)
{
if (selObj.options[i].selected)
{
var option = new Option(selObj.options[i].text,selObj.options[i].value);
option.title = selObj.options[i].text;
selObj2.options[count] = option;
count=count+1;
selObj.options[i] = null;
i--;
}
}
}
Thanks in advance
var option = new Option(...); option.selected = true;?