title: How to insert text into existing text in a div using jQuery
body: <p>I'm using jQuery 1.8.2 with a jsp and I'm trying to get text dynamically inserted into a div.  Here is what I've tried:</p>
  
  <pre><code>var selectButton = "Your " + $(this).val();
  alert("The selectButton value is: ")
  $('#submitMsg').prepend(selectButton);
  $('#submitMsg').show();
      ...         
  
  &lt;p/&gt;
  &lt;div id="submitMsg" style="display: none;"&gt;&lt;h3&gt; request is being submitted..&lt;/h3&gt;&lt;/div&gt;
  &lt;p/&gt;
  &lt;div id="trueDiv" style="display: none;"&gt;&lt;h3&gt; request was successful!&lt;/h3&gt;&lt;/div&gt;
  &lt;div id="falseDiv" style="display: none;"&gt;&lt;h3&gt; request was not successful!&lt;/h3&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I want to dynamically pass in which request, based on which submit button was clicked, to the message div.  Then I want to use that same text value and insert it into the request message confirmation, based on the result of the web service call, still using the same  size font, but I've been unable to do this.  </p>
  
  <p>Using .prepend doesn't seem to merge the text well, so I need something that will directly insert it into the text of the div.  What should I be using?</p>
  
  <p>After I got the answer here I found a tutorial at this <a href="http://www.mkyong.com/jquery/jquery-how-to-get-the-tag-value-or-element-content/" rel="nofollow">link</a>.  Should be helpful for similar tasks.</p>