$("form img[onclick]").each(function(i){
if($(this).attr("onclick") == "confirm()") {
$(this).css("border","2px solid red");
}
});
//Find all of the images with an onclick event of confirm() and Makem red.
function confirm() {
alert("red")
}
function somethingelse() {
alert("not red")
}