title: jQuery - Look for a specific word
body: <p>I am trying to display different content on wp post depending on a metabox (Dropdown)'s value. So if I had "Video", "Code" and "Image" available as options in the dropdown, I though of making a hidden div that would say "Video", "Code" or "Image" depending on selected one. Then I need jQuery (or Javascript) to look at the hidden div for ether word, and show/hide some div's.</p>
  
  <p>Here is some code I have so far.</p>
  
  <pre><code>if (jQuery("div.type:contains('Video')")) {
  jQuery(".Code").hide();
  jQuery(".Image").hide();
  }
  </code></pre>
  
  <p>But I need is to hide all div's except the correct one.</p>
  
  <p><strong>Example</strong> </p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="type"&gt;video&lt;/div&gt;
  &lt;div class="Video"&gt;Video Here&lt;/div&gt;
  &lt;div class="Code"&gt;Code Here&lt;/div&gt;
  &lt;div class="Image"&gt;Image Here&lt;/div&gt;
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>if (jQuery("div.type:contains('video')")) {
  jQuery(".Video").show();
  jQuery(".Code").hide();
  jQuery(".Image").hide();
  }
  if (jQuery("div.type:contains('code')")) {
  jQuery(".Video").hide();
  jQuery(".Code").show();
  jQuery(".Image").hide();
  }
  if (jQuery("div.type:contains('image')")) {
  jQuery(".Video").hide();
  jQuery(".Code").hide();
  jQuery(".Image").show();
  }
  </code></pre>
  
  <p>Why is this not working?</p>
  
  <p>Look at jsfiddle whatever is entered into <code>&lt;div class="type"&gt;</code> it will show <code>&lt;div class="Image"&gt;Image Here&lt;/div&gt;</code></p>
  
  <p>jsfiddle Link <a href="http://jsfiddle.net/aled2305/uREUT/161/" rel="nofollow">HERE</a></p>