JSFiddle - React, Tailwind, and code Playground

by gokulmaha

HTML

<div id="p1">
 <span>0</span>
</div>
<div id="p2">
  <span>0</span>
</div>

CSS

#p1,#p2{
   height:50vh;
   border:2px solid #ccc;
 }

JavaScript

$(document).ready(function(){
 
 $(document).on('click','#p1,#p2',function(){
 var _this = $(this).find('span');
 		var x = parseInt(_this.text());
   _this.text(x+1);
 })
})