把src属性的值设置为title属性的值:
$("img").attr("title", function() { return this.src });
为所有图像设置src和alt属性:
$("img").attr({ src: "test.jpg", alt: "Test Image" });