Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  <style>
    .filtered{ display: none; }
    .even { color:red; background-color:blue;}
  </style>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
</style>
</head>
<body>
  <p>Open your console and <a href="#" id="theLink">click here</a></p>
  <p>As you can see, it thinks the selector is missing a closing parenthesis, when it isn't.</p>
  <div id="div1"><p class="a">I'm a paragraph</p></div>
  <div id="div2"><p class="b">I'm a paragraph</p></div>
  <div id="div3"><p class="a">I'm a paragraph</p></div>
  <script>
    $("#theLink").click(function(e) {
      e.preventDefault();
      console.log("Find divs with paragraphs where the paragraph is not class='b':");
      $('div:has(p:not(.b))').each(function() {
        console.log("Found " + this.id);
      });
    });
  </script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers