JSFiddle - React, Tailwind, and code Playground

by master1991

HTML

<div class="a">
  
  <div class="b">
    
    
  </div>
  
</div>

CSS

div.a{
  height: 100px;
  width: 100px;
  border: solid black 1px;
}

div.b{
  height: 50px;
  width: 50px;
  border: solid black 1px;
}

JavaScript

$(document).ready(function(){


	$(".a").click(function(e) {
  
  	$(".b", this).css("background-color","red");
  
  });
  
  
});