show img title as caption with js figcaption method

0 votes
182 views
added Oct 29, 2020 in jQuery by lcjr First Warrant Officer (11,700 points)
$('.news-content img.Caption,.news-content img.caption').each(function(){
 var captext = $(this).attr('title');
 captext = '<figcaption class="captext">'+captext+'</figcaption>';
 $(this).after(captext);
})

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...