I have the following HTML code:
<td class="myclass" width="1%" align="right" ><a href="javascript:goToNav();" id="top"><img id="navup" src="#topofpage.png" alt="Back to Navigation"/></a></td>
I am using IE8 and based on a condition, I actually want to hide all occurrences of this image (8 in total displayed on the page) but based on my code here, it is only hiding just one occurrence only.
My code is:
if ($("#FIELD").val() == ""){
$('img#navup').each(function() {
$(this).hide();
});
}
IDs should be unique for each page. Try setting the
class="navup"instead, and use the selector$('img.navup')instead.