I have a simple html page that sources a javascript file. The javascript file’s only purpose is to write the following…
document.write('<a href="http://www.linktosite.com"><img src="http://www.location.com/image.png"></a>');
Once the information has been written, im needing some javascript to extract the url and the image source and return the url and image locations alone.
Any help is appreciated. Thank you in advance!
Check out this answer which gives shows you how to do it with JQuery or just plain Javascript
UPDATE:
If you have the ability to modify the HTML, then why don’t you put in a DOM element that you can hook on to right after where the image will be inserted? Then you can use the following JQuery:
Which you can see in this JSFiddle example