SyntaxFix
Write A Post
Hire A Developer
Questions
If you don't have an id on the image but have a parent div this is also a technique you can use.
<div id="myDiv"><img src="http://www.example.com/image.png"></div> var myVar = document.querySelectorAll('#myDiv img')[0].src