title: Check if child div with specific data attribute exists in parent section using JQuery
body: <p>How can I check if a parent <code>section</code> has another 'child' <code>div</code> with a specific data attribute? Here is something I'll to do:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>if ($("#parent").children().data("child-nr").contains("1") == true) {
      $("#parent").css('background-color', 'green');
  }
  else {
      $("#parent").css('background-color', 'red');
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>div {
    width: 50px;
    height: 50px;
    background-color: lightblue;
    float: left;
    margin: 5px;
    text-align: center;
    vertical-align: middle;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;section id="parent"&gt;
      &lt;div data-child-nr="1"&gt;&lt;p&gt;N° 1&lt;/p&gt;&lt;/div&gt;
      &lt;div data-child-nr="2"&gt;&lt;p&gt;N° 2&lt;/p&gt;&lt;/div&gt;
      &lt;div data-child-nr="3"&gt;&lt;p&gt;N° 3&lt;/p&gt;&lt;/div&gt;
  &lt;/section&gt;</code></pre>
  </div>
  </div>
  </p>