The Tutorial describes you a Array Values code in JavaScript. The Program create a HTML page specifying a button name 'Display Array Values'.
JavaScript Array Values
The Tutorial describes you a Array Values code in JavaScript. The Program create a HTML page specifying a button name 'Display Array Values'. An array variable instantiate an array object, that hold the element. On the click event of button, a function display ( ) is invoked that include a variable str. The str hold the values of the array object. The for loop execute and run the script till the value of variable i is less than array length.
The concatenated str and array are assigned to a variable str.
document.getElementById - This return you the element on the basis of respective element Id.
On loading of this code, the browser displays you the value of element in str variable.
JavaScriptArrayValues.html
<html>
|
Output of the program