title: how to make an event happen when click a button on HTML by using javascript
body: <p>I am trying to make HTML print out "Germany" when you click the button. But it is not working correctly. Is there something wrong in my code?</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;input type="button" value="click!" onclick="shuffle();"/&gt;
  &lt;div id="output"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>(function(){
      window.onload = function(){
          alert("welcome to my trip record");
      }
  })();
  
  var shuffle = function(){
      var target = document.getElementById("output");
      target.innerHTML = "Germany";
  }
  </code></pre>