Aklımda Kalası Kelimeler

* давайте работать вместе
* Zarf ve Mazruf, Zerafet(xHoyratlık) ile aynı kökten(za-ra-fe) gelir
* Bedesten
* Suç subuta ermiştir - Suç sabit olmuştur
OPTION etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
OPTION etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

9 Mart 2010 Salı

Javascript ile Select içindeki seçili option elementinin sırasını değiştirmek



<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>