I’m using the following code to grab the title attribute from each image I have in my list:
$("ul#images li img").each(function(index) {
$(this).attr("title");
});
How can I then use this attribute as a caption for each image? Do I first need to somehow convert it to a string and then append it to the list item?
Thanks
You’ll need some CSS and a modification to your javascript. But basically you grab the attr value and append it to where you like.
Using your example:
http://jsbin.com/irabiv/1/edit