i have this JS code
and here is the buttonsCode: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);} }
it only works on the second click!?? driving me nuts!HTML Code:<input type="button" value="∧" style="color: blue;" onclick="move(this.parentNode.parentNode.rowIndex,-1)"> <input type="button" value="∨" style="color: blue;" onclick="move(this.parentNode.parentNode.rowIndex,1)">




Reply With Quote