<canvas id="can" height="500px" width="1200px"></canvas>
<div class="name">
<h1>LEONARDO</h1> </div>
<script>
var name=['WATSON','LEONARDO',"SMITH","EMILY"]
var counter=0
var data=document.getElementsByClassName("name")[0].value;
console.log(data);
undefined
is displayed on the console.