Skip to content

Instantly share code, notes, and snippets.

@dbergey
Created May 21, 2010 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbergey/409184 to your computer and use it in GitHub Desktop.
Save dbergey/409184 to your computer and use it in GitHub Desktop.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script>
$.extend($.expr[':'], {
childless: function(a) {
return !$(a).children().not('a').size();
}
});
$(function() {
console.log($('.value:childless').get());
});
</script>
<div class="value">Some value</div>
<div class="value">Some <a href="#">value</a></div>
<div class="value">
<span class="address-1">...</span>
<span class="address-2">...</span>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment