title: Newbie's code not working
body: <p>I've recently started learning Javascript and writing my first pieces of code. This one is supposed to capture text input and add it to a list, but for some reason it doesn't work.</p>
  
  <p>I've been looking at it for half an hour and I can't see where I went wrong. Would you mind giving me a hand?</p>
  
  <p>window.onload = init;</p>
  
  <pre><code>function init() {
      var textInput = document.getElementById("songTextInput");
      textInput.onKeyPress = handleKeyPress;
      var button = document.getElementById("addButton");
      button.onclick = handleButtonClick;
      loadPlaylist();
  }
  
  function handleKeyPress() {
      if (textInput.keyCode == 13) {
          handleButtonClick;
      }
  
      function handleButtonClick() {
          var songName = textInput.value;
          if (songName == "") {
              alert("Please enter a song");
          } else {
              var textInput = document.getElementById("songTextInput");
              var songName = textInput.value;
              var li = document.createElement("li");
              li.innerHTML = songName;
              var ul = document.getElementById("playlist");
              ul.appendChild(li);
              save(songName);
          }
      }
  }
  </code></pre>