check if a selector contains any elements


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if($(selector)[0]){ ...code... }.

URL: http://james.padolsey.com/javascript/things-you-may-not-know-about-jquery/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.