<div class="fruit" id="whole">
<img class="fruit1" />
<img class="fruit2" />
</div>
<script>
var img1=document.createElement("img");
img1.src="http://us.yimg.com/i/us/nws/weather/gr/32ds.png";
document.getElementById("whole").appendChild(img1);
</script>
I only know how to add <img>
tag in the parent class, and output a image in it, like the code does.
However, I don't know how to output a image to the child class, i.e,"fruit1"