<!DOCTYPE html>
<head>
<title>Recipe</title>
<script src="html5.js"></script>
<script>
window.onload=function() {
var imgString = "";
// find all articles
var articles = document.getElementsByTagName('article');
// find all images in articles
for (var i = 0; i < articles.length; i++) {
var imgs = articles[i].getElementsByTagName('img');
// print out src
for (var j = 0; j < imgs.length; j++) {
var img = imgs[j];
imgString+=img.src + "<br />";
}
}
document.getElementById("result").innerHTML=imgString;
}
</script>
</head>
<body>
<div id="result"></div>
<article>
<p><img src="http://image.music.naver.net/album/204/000/001/1846.jpg" alt="" /></p>
<p><img src="http://image.music.naver.net/album/204/000/000/153.jpg" alt="" /></p>
<p><img src="http://image.music.naver.net/album/204/000/150/150563.jpg" alt="" /></p>
</article>
<article>
<p><img src="http://image.music.naver.net/album/204/000/001/1003.jpg" alt="" /></p>
</article>
</body>
// Code goes here
/* Styles go here */