title: Automatically adding the 'alt' attribute to every image on a page
body: <p>I have a requirement to add the <code>alt</code> attribute to each of the images on each of my web pages. The problem is that there are <strong>hundreds</strong> of images on some of those web pages.</p>
  
  <p>Can anyone suggest an approach using JavaScript or jQuery that, for each image on a page, copies the name of the image (minus the extension) to a new <code>alt</code> attribute?</p>
  
  <p><strong>Before:</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;img src="android.jpg width="100" height="50" /&gt;
  </code></pre>
  
  <p><strong>After</strong> (exclude ".jpg")<strong>:</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;img src="android.jpg width="100" height="50" alt="android" /&gt;
  </code></pre>