Return to Snippet

Revision: 6847
at June 19, 2008 10:07 by ezerick


Initial Code
<script type="text/javascript">
var images = document.getElementsByTagName('img');
for (i = 0; i < images.length; i++)
{	
	images[i].title = images[i].alt;
}
</script>

Initial URL


Initial Description
Firefox ignores the alt tag on images and uses the title tag whereas IE uses the alt tag. This javascript code copies the text in all image alts to the image's title. Best when placed at the footer of each page

Initial Title
Use Image Alt for Image Title

Initial Tags
javascript, image

Initial Language
JavaScript