[jQuery] Can't get .attr to work in chrome

[jQuery] Can't get .attr to work in chrome


Here is the code
$(document).ready(function(){
    $('img').attr({onclick: "Image_Click(src)"});
    $('img').css("cursor", "pointer");
});
function Image_Click(src){
    var img = $('<div><img src=\"' + src + '\" alt=\"Full size image\"</
div>');
    $(img).dialog({
        resizable: false,
        modal: true,
        title: "Full Size Image",
        width: 'auto',
        buttons: { "Close": function() { $(this).dialog("close"); } }
    });
}
This works in Firefox but will not in chrome. In chrome the .css works
and changes the cursor to the hand on hover however .attr does not
work it doesn't put the onclick attribute on any of the images. What
am I missing?