if(typeof someNode.onclick == "function") {
// someNode has an event handler already set for the onclick event...
}
By the way, if you are using a library, you should say so - if you are, it might be easier/cleaner and would differ based on which library you are using...