Check, like this:
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...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…