HTML: JS:var img = document.getElementById('imgid');if(img.src == "")img.style.display = "none";
$("img").each(function () { if ($.trim($(this).attr("src")) == "") { $(this).attr("display", "none"); } });