How can I modify this code to output 2 distinct random array objects instead of just 1? I've tried so far but it only displays a single output. What could be the reason for this issue?
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
var myArray = [
"Apples",
"Bananas",
"Pears"
];
var randomItem1 = myArray[Math.floor(Math.random()*myArray.length)];
var randomItem2 = myArray[Math.floor(Math.random()*myArray.length)];
document.getElementById("randomItem1").innerHTML=randomItem1;
document.getElementById("randomItem2").innerHTML=randomItem2;
</script>
<div id = "randomItem1"> </div>
<div id = "randomItem2"> </div>
</body>
</html>