KimiEatsCode
10/8/2015 - 5:48 PM

bVRVWw

bVRVWw

<body class="ancestors">
<div style="width:500px;"> </div>
<section></section>
<nav>
  <h3>JQuery Selectors</h3>
    <ul>
      <li>Select all line item elements using * and find!</li>
      <li>Select all line item elements using * and find!</li>
    </ul>
</nav>
  <div>This is a Div</div>
  <div>This is a Div</div>
    $("div").each(function(index, element){
         someColor = Math.floor(Math.random()*16777215).toString(16);
        
        $(element).css({"background-color": "#" + someColor, "color": invertedColor});
       
    });
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
.ancestors * { 
        display: block;
        border: 2px solid lightgrey;
        color: lightgrey;
        padding: 5px;
        margin: 15px;
    }

div {
  background-color:yellow;
}