- var leftlist ;
- var rightlist ;
- function init()
- {
- if(document.getElementById('left')){
- leftlist = document.getElementById('left');
- rightlist = document.getElementById('right');
- }
- }
- function toLeft()
- {
- init();
- var newOption = document.createElement('option');
- newOption.setAttribute('value', rightlist.item(rightlist.selectedIndex).getAttribute("value"));
- newOption.text=rightlist.item(rightlist.selectedIndex).text;
- leftlist.appendChild(newOption);
- rightlist.remove(rightlist.selectedIndex);
- }
- function toRight()
- {
- init();
- var newOption = document.createElement('option');
- newOption.setAttribute('value', leftlist.item(leftlist.selectedIndex).getAttribute("value"));
- newOption.text=leftlist.item(leftlist.selectedIndex).text;
- rightlist.appendChild(newOption);
- leftlist.remove(leftlist.selectedIndex);
- }
