title: jquery indexOf replacement
body: <p>Here I have a hidden input field</p>
  
  <pre><code>&lt;input type="hidden" value="php,php mysql" id="tags"/&gt;
  </code></pre>
  
  <p>and I also have a normal input box which users could add their new tags, now I want to check if the new tag which user wants to add is already added for him or not, if it's already added, alert('already there');</p>
  
  <p>here is my code:</p>
  
  <pre><code>var already_added = $('#tags_final').val().toLowerCase();
  new_tag = new_tag.toLowerCase();
  if (already_added.indexOf(new_tag) &lt; 0){
  // add it, everything is OK
  }else{
  alert('already there');
  }
  </code></pre>
  
  <p>the above works just fine for normal values, for example now if i try to add "php", this is gonna alert('already there'), the problem is, if I add "mysql", this also sends the alert since it finds it in "php mysql", but "mysql" is another tag and it needs to be added. what's solutions come to mind for this?</p>
  
  <p>thanks for your help</p>