HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <h1>JSON Arrays</h1> <p id="point"></p> <button onclick="myFunction()">Click Me</button> <script> var data = [ { "name": "Mike", "age": 36, "number": [1, "two"] }, { "name": "Alex", "age": 30, "number": ["three", 4] } ] function myFunction(){ document.getElementById("point").innerHTML = data[1].number; } </script> <p><strong>Note</strong>: Click on the button to get all the numbers of Alex.</p> </body> </html>
OUTPUT
×

Save as Private