title: How can I open a URL inside a DIV tag using AJAX?
body: <p>I have the following php files. One that captures a user's text from a simple form, and the other echos this text. The files are shown below..</p>
  
  <p>file1.php:
      
      
      </p>
  
  <pre><code>&lt;form action="output.php" method="post"&gt;
  
  Paste text document: &lt;br&gt;&lt;br&gt;
  
  &lt;textarea name="doc" rows="5" cols="50" value=""&gt;
  &lt;/textarea&gt;&lt;br&gt;&lt;br&gt;
  
  &lt;input type="submit" name="submit" value="submit"&gt;
  &lt;input type="reset" name="reset" value="Clear"&gt;
  
  &lt;/form&gt;
  &lt;br&gt;&lt;br&gt;
  
  
  &lt;div id="output_area"&gt;
  
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>output.php:</p>
  
  <pre><code>&lt;html lang="en"&gt;
  &lt;head&gt;&lt;title&gt;Output&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  
  &lt;?php
  
  $doc = $_POST['doc'];
  
  echo $doc;
  
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want the output to be displayed between the DIV tags, rather than to load and show the output on a new page. I want the text to be output in between the DIV tags on the same page. Maybe the best way is to use AJAX to display output.php within the DIV tags and output the text after the user has clicked on the "submit" button. How can I use AJAX to do this in the most basic way possible?</p>