jquery .attr('alt','logo').css('display','none') not working !!!

Posted by Cesar Lopez on Stack Overflow See other posts from Stack Overflow or by Cesar Lopez
Published on 2010-04-29T08:57:27Z Indexed on 2010/04/29 9:07 UTC
Read the original article Hit count: 187

Filed under:
|

I have the three following lines and the first two line gets all the images on the document and hides all, but then when I add the third line shows all the images.

What I need its to hide only the images with the attribute alt=minimize and alt=maximize but for some reason hides all the images.

$('img').attr('alt', 'minimize').css("display","none");
$('img').attr('alt', 'maximize').css("display","none");


$('img').attr('alt', 'logo').css("display","inline");

I am using IE7, but it should be compatible with IE6 and IE8.

Any help would be very much appreciated.

Thanks.

© Stack Overflow or respective owner

Related posts about jquery-selectors

Related posts about attribute