<!DOCTYPE html>
<html lang="en-US">
<body>
<h1>JSON Objects</h1>
<p id="point"></p>
<button onclick="myFunction()">Click Me</button>
<script>
var data = [
{
"name": "Mike",
"age": 36
},
{
"name": "Alex",
"age": 30
}
]
function myFunction(){
document.getElementById("point").innerHTML = data[1].name;
}
</script>
<p><strong>Note</strong>: Click on the button to get the name of second object.</p> </body>
</html>