title: Concatenation as a comma separated string - Jquery
body: <p>I have a list of elements, two user input fields, and two buttons. User enters a value in the 1st input field and clicks on the button. The entered value should be appended to the existing list and should also reflect in the space provided below the input fields. All the added values should form a comma separated string.</p>
  
  <p>Ex: car, bike, bus</p>
  
  <p>How to concatenate a variable which is a user input value to form a comma separated line using jquery? </p>
  
  <p>Html:</p>
  
  <pre><code>    &lt;ol id="list"&gt;...&lt;/ol&gt; 
  
      &lt;input class="Add"&gt;
      &lt;button id="btn1"&gt; Add &lt;/button&gt;
      Added item : &lt;div class="Additem"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Jquery:</p>
  
  <pre><code>$("#btn1").click(function(){
  var additem = $(".Add").val();
  $("#list").append("&lt;li&gt;" + additem + "&lt;/li&gt;");
  $(".Additem").append("&lt;div&gt;" + additem + "&lt;/div&gt;");
  </code></pre>
  
  <p>Line 4 in the above code appends the variable but in a different line.</p>
  
  <p>Above operation shows a method of appending a user input value to list. What is the method to delete a user input value which is a part of list?</p>