_content: fix go.dev/play not to select example on load

Select the "hello.go" example on load will make it run.
But it will overwrite the source code that a user want to restore
by reopening the unintentionally closed tab from the browser history.

Since the example code is already loaded without the select action,
let's remove the select action and trigger the click event of the Run
button directly.

Note that we should replace the "DOMContentLoaded" event with
the "load" event. Otherwise, the click event will be triggered before
the user content is restored, which will prevent the user content
being restored.

Fixes golang/go#49895

Change-Id: I897e22a5accc3271deaea5fa3b2f218fe66603d3
GitHub-Last-Rev: dc930974e350ecaeb82cc6822d818c6a326a4576
GitHub-Pull-Request: golang/website#161
Reviewed-on: https://go-review.googlesource.com/c/website/+/407055
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
diff --git a/_content/js/playsite.js b/_content/js/playsite.js
index b43b3ff..911cc89 100644
--- a/_content/js/playsite.js
+++ b/_content/js/playsite.js
@@ -4,7 +4,7 @@
 
 // for /play; play.js is for embedded play widgets
 
-window.addEventListener('DOMContentLoaded', () => {
+window.addEventListener('load', () => {
   // Set up playground if enabled.
   if (window.playground) {
     window.playground({
@@ -23,7 +23,7 @@
 
     // The pre matched below is added by the code above. Style it appropriately.
     document.querySelector(".js-playgroundOutputEl pre").classList.add("Playground-output");
-    $('.js-playgroundToysEl').val("hello.go").trigger("change")
+    $('.js-playgroundRunEl').click();
 
     $('#code').linedtextarea();
     $('#code').attr('wrap', 'off');