I have a 2 running list that a stored in the hidden form variable. 1 is to keep selected items another is to keep deleted items. When i click on delete icon i need to remove the item from the first list and add it to the second list. Addition piece is working .
I have a code for deletion but it does not work
var newrID = 'r' + ID;
var list = $('#' + newrID).val();
var index = list.indexOf(ID2);
$("#" + newrID).val(list).find(ID2).remove();