I have this line of code:

<div class="blue" onclick="myfunction()" id="blue2">

This works fine and makes the JavaScript work if you click the Div.

Is there a way to make it so you don't have to click it, but it works automatically upon page load?

Thanks.