title: Get wordpress posts from certain category if statement
body: <p>I'm trying to get wordpress posts belonging to a certain category if a condition is met.
  So basically there is a <code>select</code> dropdown where the user chooses a category. Once they haven chosen said category I want to display the posts of that category, so something like:</p>
  
  <pre><code>&lt;script&gt;
  var postID = "Case Study"  // category name
  
  jQuery("#test").change(function(){
      if(jQuery(this).val()==postID){
           // get the posts of the category that is equal to Case Study
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I know how to do this if it was just one category i.e Case study, however as they have got the choice from several categories I need to somehow match the selected category and post only the posts from that category.</p>
  
  <p>Any ideas?</p>