I would like to add different colours to different texts. The list of colours that I would like to add is stored in an array. How will I use that array to assign colours to my texts? Please check the code that I have written. The text "hai" is supposed to be in cyan colour. But the output is not as expected.
<!doctype html>
<html>
<body>
<script>
var colors=['blue','cyan','gold','grey','green'];
</script>
<h1 style="color:colors[1]">hai</h1>
</body>
</html>