title: jQuery .each() wildcard - Select all elements with class starting with specific string
body: <p>I am animating different <code>div</code>s (jQuery and jQuery UI), so I have created classes like ,<code>slidein</code>, <code>fadein</code>, etc., and I can apply them to whatever I need to animate. In my Javascript file, a <code>.each()</code> loop is run to find every element with a class of <code>fadein</code> or <code>sidein</code></p>
  
  <p>What I want to do is be able to choose how long the animation takes, by adding a class of <code>fadein-x</code>, where <code>x</code> is the number of milliseconds it took. For instance:</p>
  
  <p><code>.fadein-500</code> - Element will take <code>500</code> milliseconds to fade in</p>
  
  <p><code>.slidein-1000</code> - Element will take <code>1000</code> milliseconds to slide in</p>
  
  <p>Using a <code>.each()</code> function I can loop through the elements with a specific class, but could I loop through all the elements with a class that starts with a specific string, like a wildcard? Maybe something like this (where <code>*</code> is the wildcard):</p>
  
  <pre><code>$('.fadein-*').each(...)
  </code></pre>
  
  <p>The above would select all elements with the <code>fadein-</code> class, and then I could slice the class to get the time, and apply the animation.</p>
  
  <p>So, in conclusion, this is what I want:</p>
  
  <p><strong>Be able to animate elements with a customizable time, without having to change a Javascript file</strong></p>
  
  <p>If there is another way to do what I am trying to do, please tell me! Thanks</p>
  
  <p><strong>Note:</strong> The reason I need this is because I am creating a Wordpress theme, and I will be using PHP to echo a time the user types in. Obviously I don't want to create 3000 different classes for every time in milliseconds possible</p>
  
  <p>Also, <a href="https://stackoverflow.com/questions/8579108/jquery-has-class-that-starts-with">this question</a> is not the same, the OP was asking about something different</p>