/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// 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; }