I have a table with persons and I want to sort them manually, but without drag and drop. I just want so select a person by clicking on the row, select another person by clicking on them and then the two should switch positions.
I've no problem to select one row, but I'm stuck at how to select the second one. I think switching the rows could be possible with jQuery replaceWith.
$(document).ready(function(){
var selections = new Array(2);
$("tr").click(function() {
var selected = $(this).attr('id');
//highlight selected row
$(this).toggleClass("marked");
})
});
I've created a fiddle here: http://jsfiddle.net/zLz929xy/3
Any help or hints would be great.