Jquery : Concatenate Values From Two Elements
<p>bit stuck try to achieve something in Jquery and wondered if anyone can assist..</p>

<p>I am creating my own edit in place function, where you click on an edit button, and the content of my definition list gets swapped for a form...prefilled with data. Similar to <a href="http://15daysofjquery.com/examples/jqueryEditInPlace/divEdit.php" rel="nofollow">this</a></p>

<p>All is fine apart from each editable section (user comments) is tagged, and can have multiple tags, much like here on stackoverflow...So my HTML to output the tag for each comment is as so</p>

<pre><code> &lt;dl id='comment_id'&gt;
  &lt;dt class="comment title"&gt;#i.getsTitle()#&lt;/a&gt;&lt;/dt&gt;
           // Other info
    &lt;dd class="categories"&gt;
        &lt;dl&gt;
      &lt;dt&gt;Tags:&lt;/dt&gt;
    &lt;cfloop array="#i.getCategory()#" index="ii"&gt;
     &lt;dd class="category"&gt;&lt;a href=""&gt;#ii.getsCategory()#&lt;/a&gt;&lt;/dd&gt;
 &lt;/cfloop&gt;
  &lt;/dl&gt;
   &lt;/dd&gt;
</code></pre>

<p></p>

<p>So i nest my categories or tags in an a definition list, controlled by a loop. </p>

<p>What i have tried to do so far is grab the content of these catergories using Jquery, so that when you click to edit, the category form field will be prefilled with the existing tags for that comment....</p>

<pre><code>$('.edit').click(function(){
  // Grab the text for all categories
 var sCategory = $(this).parents('dl').find('dd.categories dl dd.category').text();

 //Build a form and prefill the category form field with the sCategory Variable
 form + '' // Other Data to build form 
 form += '&lt;dl&gt;&lt;input name="sCategory" type="text" value="' + sCategory + '" /&gt;&lt;/dl&gt;'

 // Show edit form prefilled with appropriate content
 $('dl#comment_id).(form);
</code></pre>

<p>This works, but it displays all the categories for that entry next to each other, with no spaces....eg "JqueryColdfusionValidation". Was wondering how to display it as so "JqueryColdfusionValidation"....Im guessing the .each function is required here, but a bit stuck on how to implement</p>

<p>Many thanks</p>
