Added onclick action to each element in the list