title: Hide input="image" if image src not found
body: <p>I'm using the following JavaScript function to hide images on my webpage in the event that the source image is not found:</p>
  
  <pre><code>function Image_OnError(image) {
      image.onerror = "";
      image.style.visibility = "hidden";
      return true;
  }
  </code></pre>
  
  <p>I add the following attribute to my images which calls the above method in the event of an error <code>onerror="Image_OnError(this);"</code>.</p>
  
  <p>The problem is that I need to do the same for <code>&lt;input type="image" /&gt;</code> elements but can't figure out how to do this as the input element doesn't appear to have an <code>OnError</code> event.</p>
  
  <p>I could just include an extra image with the same src value as the input and then modify the visibility of the input element on the image's OnError event, but this seems a bit messy.</p>