How to compare the items from the selected list?