I have different iframes that embed youtube videos or slideshare presentation. I was able to get src from iframes but I want to show for any iframe a div with the correct src url. Actually I'm using this code:
$.each($("iframe"), function() {
var src = $(this).attr('src');
$(this).attr('src', src);
console.log(src);
$(".avia-iframe-wrap").before('<div>' + src + '</div>');
});
Problem is that I get all the src url of the page above any iframe, see the attached image: attachment
Basically I need to show only youtube url above youtube iframe and only slideshare url above slideshare iframe. Thank you for your help.