I’ve got a JavaScript-function that sets the “onclick”-event of some HTML-Nodes – even if that “onclick”-event has been set before.
How can i check if that event has already been set, so I can extend my function to set the event only on HTML-Nodes where it has not already been set?
Check, like this:
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…