title: jQuery Do not append on table if the specific value already exist
body: <p>My Code is totally all working fine but my only concern is how can I validate if the appended value already exist on the table. This is what i've done.</p>
  
  <pre><code>&lt;body&gt;
  &lt;form&gt;
      &lt;select id="name"&gt;
          &lt;option value="-"&gt;-&lt;/option&gt;
          &lt;option value="Mark"&gt;Mark&lt;/option&gt;
          &lt;option value="James"&gt;James&lt;/option&gt;
          &lt;option value="Steve"&gt;Steve&lt;/option&gt;
      &lt;/select&gt;
      &lt;input type="button" class="add-row" value="Add Row"&gt;
  &lt;/form&gt;
  &lt;table id="dynamic_field"&gt;&lt;/table&gt;
  </code></pre>
  
  <p> </p>
  
  <p>My concern is only on the  <code>if ($('#dynamic_field').has(name))</code>  part. I want to validate if it already exist. </p>
  
  <pre><code>    $(document).ready(function(){
      var i = 0;  
      $(".add-row").click(function(){
          i++;
          var name = $("#name").val();
          var markup = '&lt;tr id="row'+i+'"&gt; &lt;td&gt; &lt;button type="button" name="remove" id="'+i+'" class="btn_remove"&gt;Delete &lt;/button&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" value="'+name+'" name="owners"&gt; '+name+'&lt;/td&gt; &lt;/tr&gt;';
          if(name != '-') {
              if ($('#dynamic_field').has(name)) {
                  alert('already exists in the table');
              } else {
                  $('#dynamic_field').append(markup);
              }
          }
      });
      $(document).on('click', '.btn_remove', function(){  
       var button_id = $(this).attr("id");   
       $('#row'+button_id+'').remove();  
   });  
  });  
  </code></pre>