title: how to convert from string to array in javascript?
body: <p>So, I am reading some data with document.getElementById which is already an array.But somehow when I am reading it, it is resulting in a string insted.</p>
  
  <p>I am using the document.getElementById('clients').value, and apparently this returns a string, while I would like to get an array instead.</p>
  
  <pre><code>var clients = [];
  clients = document.getElementById("clients").value;
  alert(clients);
  console.log(clients);
  
  for(var i =0; i &lt; clients.length; i++){
      var client = clients[i].toString().split(',');
      alert(client);
  }
  
  //console.log(clients) gets:
  ["[['1'", " 'client1']", " ['2'", " 'client2']", " ['3'", " 'client3']]"]
  </code></pre>
  
  <p>when I am alerting the client from the for loop, I am getting each and every character found in clients one by one. While I would like to get an object to split it. Thanks a lot in advance.  </p>