Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
jQuery Set Image TITLE from ALT Tag
jQuery(document).ready(function($) {
$("img:not([title])").each(function() {
if($(this).attr("alt") != '') $(this).parent().attr("title", $(this).attr("alt"));
else $(this).parent().attr("title", $(this).attr("src"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.