So if the image tag is
I don\'t know how to e
Make the URL as an array and than take the second to last part. For example this also works with CSS background-image.
id = $('div').attr('style').split('/'); id = id[id.length-2]; alert("YouTube ID: " + id);
https://jsfiddle.net/Wobbo/wfyL1hem/7/