JS Tutorial JS HTML DOM JS Browser BOM JS Examples Displaying Arrays In this tutorial we will use a script to display arrays inside an HTML element: Example document.getElementById("demo").innerHTML = cars; The first line (in the script) creates an array named cars. The second line "finds" the element with id="demo", and "displays" the array in the "innerHTML" of it. Try it Yourself Example Example What is an Array? An array is a special variable, which can hold more than one value at a time. If you have a list of items (a list of car names, for example),
Read full article from JavaScript Arrays
No comments:
Post a Comment