title: check whether an element exists using jQuery
body: <p>I want to make the jquery working only when the particular #id or .class is available. i want to know which one is correct ??? please help... Thanks</p>
  
  <pre><code>if($().flexslider) {
  //do something
  }
  
  or
  
  if ( $( '#flexslider' ).length &amp;&amp; jQuery().flexslider ) {
  //do something
  }
  </code></pre>