So I use jquery often but dont actually know much about JS if we are being honest. I am going through W3schools and was working with this specific "try me" snippet
http://www.w3schools.com/js/tryit.asp?filename=tryjs_datatypes_array
So I thought - maybe I can play with it to make it more complicated and use it in a way that I would when personally coding a layout or UI.
So I created this JS fiddle. Trying to put a specific <div> as each variable. I was unsuccessful. What would be the proper way of achieving this?
Here is my JS FIDDLE
Here's the required code snippet of my Horrible js:
var boxes = [
"<div class='box' id='1'> hello1 </div>"
,"<div class='box' id='2'> hello2 </div>"
,"<div class='box' id='3'> hello3 </div>"
];
document.getElementById("demo").innerHTML = boxes[0]