CodePen

HTML

            
              <div class="parent">
  I should change my color to green when clicked
  <div class="element">I should do nothing when clicked</div>
</div>
            
          
!

CSS

            
              .parent {
  width:200px;
  height:200px;
  background: red;
  color: #fff;
}
.element {
  background:blue;
}
  
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              $('.parent').mousedown(function(e){
    if ($(e.target).is(this))
        $('.parent').css('background', 'green');
    }).mouseup(function(e){
    if ($(e.target).is(this))
        $('.parent').css('background', 'red');
});
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................