isElementSelected function

Determine if an element is currently selected.