title: Using multiline listboxes to create message using JS
body: <p>Need your help with this...I have listbox, textarea and button. Listbox is multiline and when a button is clicked the chosen line appears in textarea. The logic is simple but there is a problem. The thing is that i dont have only one listbox. I have another button which can add another or more similar listboxes with the same information(populating listboxes). So lets say that I need so many listboxes to add the names of friends to the textarea which is going to be used as letter in future. So im doing kind of program that will create message with default text just including names of friends. Anyway here is the code:</p>
  
  <pre><code>    function textSelect(){
  var listItems = document.getElementById("listbox")
  for (var n=0;n&lt;listItems.length;n++) {
  for (var i=0;i&lt;listItems[n].length;i++) {
  document.getElementById("textArea").value += 'This is  ' + listItems.text;}
  } 
  }
  </code></pre>
  
  <p>here n - is listboxes and i -  is lines...But all I get as the result is blank textarea after clicking on the button. What is wrong here? please help me!!</p>