How do I, just with javascript, and without using
<whateverelement onClick="whateveraction"/>
grab the onClick event and validate if it's some specific element, i.e. an image?
As far as I know, onclick is the only way to intercept such an event, so you'll have to do it this way.
What do you want to achieve with this ?
If you want to execute the onclick without coding it in your element, you could try document.theElement.onclick="";
Not sure if it works but I guess so. Is this what you're looking for?
What I want to do is to completely separate content, behavior and styles. To separate styles, you have CSS. To separate behavior, you have to quit using 'onHandler' attributes on your markup; and I want to know how can I do it...
here's a quick scribbling to describe what I mean

Separating content, behaviour and style is a good way to build pages. However, you need to connect the elements to their behaviours. So keep on using the onHandler attributes, but put your script in a separate file (handlers.js, for example). This way you have separated behaviour from content, AND you can simply use the same scripts in different pages.
I hope it helped.
Can't you set the handlers in your script like i said earlier somehow?
document.getElementById("").onClick=...();
I just did
just realized that I MUST -like in 'no choice here folks'- initialize the functions for them to work. Curiously, at least for IE and Firefox not putting the handling statements in functions doesn't mean that they will be executed anyway. Weird huh?