</body>
</html>
<script type="text/javascript">
var select1 = $("Select1");
var select2 = $("Select2");
var select3 = $("Select3");
var optionArray = new Array(new Array("item1","item1"),new Array("item2","item2"),new Array("item3","item3"),new Array("item4","item4"),new Array("item5","item5"));
function addOption(select,optionText,optionValue)
{
var option = document.createElement("option");
select.options.add(option);
option.innerText = optionText;
option.value = optionValue;
}
function removeOption(select,index)
{
select.options.remove(index);
}
function add()
{
var i = select1.selectedIndex;
if(i != -1)
{
addOption(select2,select1.options[i].text,select1.options[i].value);
addOption(select3,select1.options[i].text,select1.options[i].value);
removeOption(select1,i);
}
refreshAll();
}
function remove()
{
var i = select2.selectedIndex;
if(i != -1)
{
addOption(select1,select2.options[i].text,select2.options[i].value);
removeOption(select2,i);
removeOption(select3,i);
}
refreshAll();
}