Examine DOM elements for event handler functions

Is it possible to examine DOM elements for event handler functions in order to construct conditionals?

E.g.:

domElement.onclick == eventHandlerFunction ? doThis() : doThat()
// I'm unsure whether the conditional in this ternary expression
// evaluates to anything, or what syntax to use to get at the same idea.

We cannot compare an event listener, only assign a callback. The logic you are attempting would need to be taken into account within the handler function (the callback).