document.getElementById("imgId").getAttribute("src")
使用jquery,语法简单,兼容性好,语法$("#img标签的id").attr("src");
这里面图片是动态的。jquery的attr只能取得第一张照片。