0

I have this code and its supposed to show the string in the script element but it only shows [object Object] and its supposed to show ["John", 90]

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1 id="student-list">Hello</h1>

<script>
    var student = [
    {name: "John", grade: "90"}
    ];

    var studentl = document.getElementById("student-list");
    studentl.innerHTML = student;
</script>
</body>
</html>

0 Answers0