Return to Snippet

Revision: 856
at August 16, 2006 02:30 by Corhol


Initial Code
// if an image is missing a title attribute,
// adds title based on the alt attribute of the image
for ( i = 0; i < document.images.length; i++ ) {
    if ( document.images[i].title == "" && document.images[i].alt != "" )
    document.images[i].title = document.images[i].alt;
}

Initial URL

                                

Initial Description

                                

Initial Title
Dynamic Image Titles

Initial Tags
javascript, images

Initial Language
JavaScript