Creating a div element in jQuery How do I create a div element in jQuery? solution: First select the parent element with something like $("#id"), $("element") or $(".class") Then use the .append("<div>foo</div>") function. Alternatively, you can use the .html() as mentioned in a different answer. $("#foo").append("<div>hello world</div>") http://stackoverflow.com/questions/867916/creating-a-div-element-in-jquery
undefined
How to append something to an array? How do I append to an array in JavaScript? Solution: Use the push() function to append to an array: // initialize array var arr = [ "Hi", "Hello", "Bonjour" ]; // append new value to the array arr.push("Hola"); Now array is var arr = [ "Hi", "Hello", "Bonjour", "Hola" ]; // append multiple values to the array arr.push("Salut", "Hey"); Now array is var arr = [ "Hi", "Hello", "Bonjour", "Hola", "Salut", "Hey" ]; // display all values for (var