If you want to store multiple values in a single variable javaScript arrays are used.
There are few ways to store values in array in javascript which are mentioned below.
First way:
HTML:
<div id="fruitList"></div>
Javascript:
var fruits = ["Apple", "Orange", "Grapes"];
document.getElementById("fruitList").innerHTML = fruits;
0 Comment(s)