If the img below is present
and the script is
How about this for instance :
var youtubeimgsrc = document.getElementById("youtubeimg").getAttribute('src');