title: How can i output this content to a textarea?
body: <p>I have tried to pass on the text from a php page into my html page, as described by Chris Bakers answer (javascript, not jquery).
  <a href="https://stackoverflow.com/questions/7165395/call-php-function-from-javascript">Call php function from javascript</a></p>
  
  <p>The code works, if i use the normal text (id=output), but i would like to output the text to a textarea (id=text1) instead of a normal text, just changing the id does not work. </p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;html&gt;
   &lt;head&gt;
   &lt;/head&gt;
   &lt;body&gt;
   &lt;textarea id="text1" style="background-color: #969696" cols="50" rows="10" readonly&gt;&lt;/textarea&gt;
   &lt;div id="output"&gt;waiting for action&lt;/div&gt;
   &lt;/body&gt;
   &lt;script&gt;
  
  
      function getOutput() {
      var value = document.getElementById("artikelnr").value;
      var file = selectedValue()+".csv";
        getRequest(
            "verarbeitung.php?eingabe="+value+"&amp;eingabe2="+file, // URL for the PHP file
             drawOutput,  // handle successful request
             drawError    // handle error
        );
        return false;
      }  
      // handles drawing an error message
      function drawError() {
          var container = document.getElementById('text1');
          container.innerHTML = 'Bummer: there was an error!';
      }
      // handles the response, adds the html
      function drawOutput(responseText) {
          var container = document.getElementById('text1');
          container.innerHTML = responseText;
      }
      // helper function for cross-browser request object
      function getRequest(url, success, error) {
          var req = false;
          try{
              // most browsers
              req = new XMLHttpRequest();
          } catch (e){
              // IE
              try{
                  req = new ActiveXObject("Msxml2.XMLHTTP");
              } catch(e) {
                  // try an older version
                  try{
                      req = new ActiveXObject("Microsoft.XMLHTTP");
                  } catch(e) {
                      return false;
                  }
              }
          }
          if (!req) return false;
          if (typeof success != 'function') success = function () {};
          if (typeof error!= 'function') error = function () {};
          req.onreadystatechange = function(){
              if(req.readyState == 4) {
                  return req.status === 200 ? 
                      success(req.responseText) : error(req.status);
              }
          }
          req.open("GET", url, true);
          req.send(null);
          return req;
      }
  
  
   &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>