Check a string for certain characters
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5038105/checking-if-a-string-contains-a-certain-substring">Checking if a string contains a certain substring</a>  </p>
</blockquote>



<p>I use the <a href="http://api.jquery.com/val" rel="nofollow">jQuery <code>.val()</code></a> method to get the value of a certain input field.</p>

<p>How can I check if the returned string contains a certain character (for example, <code>','</code>)?</p>

<p>In my specific application, I use the code:</p>

<pre><code>var tag_value = $("#tag_value").val();
</code></pre>

<p>to obtain comma-separated input values from the user, and I would like to check whether the string contains any commas.</p>
