It is not that it doesnt recognide this - it does not recognise the method anything because of a setting you've made in jsfiddle - to scope the javascript into onLoad. If you would have chosen no wrap (head) it would work fine: http://jsfiddle.net/GSHsH/11/
A bit more detail. The way you set it up, this is what gets injected into the output frame in jsfiddle:
Event.observe(window, "load", function(){
function anything(theObj){
window.alert(theObj.innerHTML);
}
});
Note that the method anything is not in global (window) scope, it is in the scope of a particular function. This means its not visible to the element on the page.
The way I set it up you get this:
function anything(theObj){
window.alert(theObj.innerHTML);
}
Which is just a plain old function defined in the head of the page - now accesible from an element on the page.