Created
November 16, 2015 21:18
-
-
Save leowebguy/7d4b708695ae81f0b622 to your computer and use it in GitHub Desktop.
Get alt attribute and append title to the same element (jquery)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function($){ | |
$(".wpb_image").each(function() { | |
var title = $(this).find('img').attr('alt'); | |
$(this).append('<div class="wpb_image_title"><h4>'+title+'</h4></div>'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment