
<html>
<head>
<script>
function moveItem(i){
var b,o=document.getElementById("s1"),p,q;
if(i==0 && o.selectedIndex > 0){
p = o.options[o.selectedIndex];
q = o.options[o.selectedIndex - 1]
o.removeChild(p);
o.insertBefore(p,q);
}
if(i==1 && o.selectedIndex < o.options.length-1){
b = o.selectedIndex < o.options.length - 2;
p = o.options[o.selectedIndex];
if(b) q = o.options[o.selectedIndex + 2]
o.removeChild(p);
if(b) o.insertBefore(p,q); else o.appendChild(p);
}
}
</script>
</head>
<body>
<table>
<tr>
<td rowspan=2>
<select id="s1" size=3>
<option>One
<option>Two
<option>Three
</select>
</td>
<td>
</tr>
<tr>
<td>
</tr>
</table>
</body>
<script>
</script>
</html>
Hiç yorum yok:
Yorum Gönder