How to check if value exist in jQuery .data() function
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6108034/how-to-find-index-of-object-in-a-javascript-array-with-jquery">How to find index of object in a JavaScript array with jQuery</a>  </p>
</blockquote>



<p>I need to find value of input entered if already exists in .data() function.</p>

<p>I am trying this way.</p>

<p>jQuery</p>

<pre><code>var array = $("form[name=update]").data("values", {"v1": "value1", "v2": "value2", "v3": "value3", "v4": "value4", "v5": "value5"});

if ($.inArray("value1", array) &gt; -1){alert("duplicate value")}
</code></pre>

<p>But it does nothing.</p>

<p>Please see and suggest any possible way to do this.</p>

<p>Thanks.</p>
