Hide the tag img if empty src.


1 reply [Last post]
GrayS
Offline
Joined: 11/22/2010

I hope this is easy. I'm trying to figure out how to add "display none" to an image if the src is empty! This is what i have so far:
[CODE]
var $j = jQuery.noConflict();
$j(document).ready(function(){
var testing = $j("img#logoTest").attr("src");
if(testing == ""){
$j("img#logoTest").css("display","none");
}
});
[/CODE]

Can you tell me what im doing wrong?
Thanks!