My Jquery code for changing the alt tags on images is not working for IE 7 or IE 8 and works for FF and Chrome
<pre><code>$j("img").each(function() {
    var img = $j(this);
    var source = img.prop("src");
    var alt = img.prop("alt");
    var source1 = source.substring(source.lastIndexOf('.'), source.lastIndexOf('/'))      
    var source2 = source1.substring(1);                                                   

    if (alt || alt == "") {                                                     
        img.prop("alt", source2);
    }
    else if (alt != source) {                                                     
        img.prop("alt", source2);
    }
 });
</code></pre>

<p>/* To change alt tag image names to image names within the webpage */</p>
