i have this JS code
Code:
function move(rowindx,direction){
var tbl = document.getElementById('items');
var aRowIndex = rowindx + direction;
var curr = tbl.rows[rowindx];
var othr = tbl.rows[aRowIndex];

if (direction==-1) {othr.parentNode.insertBefore(curr,othr);}
if (direction==1) {othr.parentNode.insertBefore(curr,othr.nextSibling);}
}
and here is the buttons
HTML Code:
<input type="button" value="&and;" style="color: blue;" onclick="move(this.parentNode.parentNode.rowIndex,-1)">
<input type="button" value="&or;" style="color: blue;" onclick="move(this.parentNode.parentNode.rowIndex,1)">
it only works on the second click!?? driving me nuts!