# Onerror within the img tag?

**URL:** <https://forum.kirupa.com/t/onerror-within-the-img-tag/330619>\
**Category:** Uncategorized\
**Created:** [February 18, 2013, 10:30pm UTC](https://forum.kirupa.com/t/onerror-within-the-img-tag/330619 "2013-02-18T22:30:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Composition34](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@Composition34](https://forum.kirupa.com/u/Composition34)\
**Post date:** [February 18, 2013, 10:30pm UTC](https://forum.kirupa.com/t/onerror-within-the-img-tag/330619/1 "2013-02-18T22:30:22Z")

</div>

Okay - I work on a store (netsuite) … and I cusomize all the front end stuff. I’m calling one of the images like this:

\<img src="\<%=getCurrentAttribute(‘item’,‘custitemimage3’)%\>" width=“110” height=“150” border=“0” align=“right” id=“Img1” onclick=“document.getElementById(‘MainImage’).src=’\<%=getCurrentAttribute(‘item’,‘custitemimage3’)%\>’” alt="" onerror=“this.style.display=‘none’”/\>

… there’s a list of 3 thumbnail images … .and I’d like to use the same item template for items that have 1 thumbnail, 2 or 3 … so, for each of the img tags … i’ve included the onerror within the image tag. … So, that when there’s an image that only has 1 thumbnail, for example … .I don’t get the ugly broken image icon where the remaining thumbnails should be. This hides them correctly everywhere except in Firefox?

- Looks like there’s some javascript options to control this as well … .but I’m not having luck with anything except the inline img tag onerror… but not in firefox.
