emit events for selection and deselection of text for a given element.