I am attempting to create this with javascript so that i can repeat it as many times as I'd like
<div class="parallax-item">
<img src="http://freepngimages.com/wp-content/uploads/2015/10/bubble-transparent-background.png" alt="BUBBLE">
</div>
Here is the Javascript that I did, but when I run it nothing happens.
var makeBubbles = function (numOfBubbles) {
var div = document.createElement("div");
div.className = "parralax-item";
div.id = 'num' + numOfBubbles + 'div';
document.getElementById("main").appendChild(div);
var image = document.createElement("IMG");
image.src = "http://freepngimages.com/wp-content/uploads/2015/10/bubble-transparent-background.png";
image.alt = "BUBBLE";
document.getElmentById('num' + numOfBubbles + 'div').appendChild(image);
numOfBubbles --;
if (numOfBubbles > 0) {
makeBubbles(numOfBubbles);
}
};
makeBubbles(9);
Where did i go wrong? Also where could i see the changes that this makes to the html so that i could do some testing?