finding duplicate strings using contains
<p>I have two textboxes for getting the billing <code>item name</code> and <code>amount</code>, after fillind these two fields and clicking on <code>Add</code> button, am storing the datas into a html table like,</p>

<pre><code>$("#BillTable &gt; tbody").find("tr:gt(0)").remove();
  for (var i = 0; i &lt; feesItemList.length; i++) {          

          tab = "&lt;tr&gt;&lt;td class='close16' onclick='DeleteBillItem(" + i + ")'&gt;" 
                   "&lt;/td&gt;&lt;td&gt;" + " &lt;span class='bid'&gt;" + feesItemList[i].ItemName
                   + " &lt;/span&gt; &lt;/td&gt;&lt;td&gt;" + feesItemList[i].Amount + "&lt;/td&gt;&lt;/tr&gt;";

          $("#BillTable &gt; tbody").append(tab);

  }
</code></pre>

<p>here the <code>item name</code> should not be a duplicate one. so I just put a condition before <code>tab</code> like</p>

<pre><code>if($('bid').contains(feesItemList[i].ItemName){
    alert("Duplicate ItemName");
}
else{
    tab +=............//
}
</code></pre>

<p>but its not woriking, how can I fix this, can anyone help me here, thanks in advance</p>
