I want to get the value of the input on click then split the returned value into an array of characters, that what i've already tried :
window.onload = function() {
  var textonaut = {
    text: '',
    letters: []
  };
  textonaut.text = document.getElementById('textonaut-text').value;
  var go = document.getElementById('go-button');
  go.addEventListener('click', function(e) {
    e.preventDefault();
    textonaut.letters = textonaut.text.split('');
    for(var i = 0; i < textonaut.letters.length; i++) {
      console.log(textonaut.letters[i]);
    };
  });
}<input id="textonaut-text" type="text"><button id="go-button">go</button>I can't figure out why this doesn't work.
 
     
    