title: Which HTML elements support onerror attribute?
body: <p>I have a site that loads CSS and fonts from <a href="http://www.google.com/webfonts/" rel="noreferrer">Google Web Fonts</a>.  However, one place where the site will be used is a local intranet with no Internet access.</p>
  
  <p>I still want to use the fonts from Google where I can for the benefits that Google offers, such as the fonts being downloaded from a CDN and possibly already being cached on the user's computer from visits to another site that uses them.</p>
  
  <p>I also use <a href="https://developers.google.com/speed/libraries/devguide" rel="noreferrer">Google-hosted jQuery</a> and I use the following code (from <a href="https://github.com/h5bp/html5-boilerplate/blob/master/index.html" rel="noreferrer">HTML5 Boilerplate</a>) to load jQuery from my server if Google is not accessible:</p>
  
  <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;window.jQuery || document.write('&lt;script src="js/vendor/jquery-1.9.0.min.js"&gt;&lt;\/script&gt;')&lt;/script&gt;
  </code></pre>
  
  <p>I am looking for a way to do the same for CSS files.</p>
  
  <p>I have used <code>&lt;img src="..." onerror="..." /&gt;</code> in the past for handling images that don't load, so I was wondering if I can use that for stylesheets that don't load too.  I did a quick test in a few browsers, using  <code>&lt;link href="..." onerror="..." rel="stylesheet" type="text/css" /&gt;</code>, and the <code>onerror</code> was executed in all of them, but I would like to find out if I can expect this to work consistently in all browsers.  <em>Or is there a better way to do it?</em></p>
  
  <p>I saw several other answers here that discuss watching the <code>document.styleSheets</code> collection, but that sounds like much more of a hack than this does.</p>
  
  <hr>
  
  <p>Note: This is really more of a "is this practical and do people use it"-question than a "what does the spec have to say about it"-question.</p>