$("img").attr({ src: "test.jpg", alt: "Test Image" });
If you want to det just the src attribute, use:
$("img").attr("src","test.jpg");
If you want to set Title attribute of an image to reflect image filename, use:
$("img").attr("title", function() { return this.src });
No comments:
Post a Comment