You can create a custom selector (probably very inefficient though):
$.extend($.expr[':'], {
onclick: function(node, index, args, stack) {
var events = $(node).data('events');
var fn = args[3];
if (!events || !events.click) return false;
for (i in events.click) {
if (events.click[i].name == fn) return true;
}
return false;
}
});
$("input[type='button']:onclick('save')")
function.name
does not work in IE though, so you will have to jump through another hook using toString() and regexps. All in all, you are far better off manually maintaing a list of event handler names.
Edit: looking at your code snippet, there seems to be no reason at all to search for event handlers. Instead of wildly throwing attribute selectors around, use classes and ids to address your elements in a semantically meaningful way, e.g.
<img id="scroll-icon" src="icons/scroll.gif" />
<input id="submit-button" type="submit" onclick="save();" />
and then
$("#scroll-icon".click(function(){
var targetOffset = $("submit-buttton").offset().top;
$("html,body").animate({scrollTop: targetOffset}, 400);
});