JSFiddle - React, Tailwind, and code Playground

HTML

<div class='test1'>
<input type='checkbox'>
</div>

CSS

.test1 {
  background: blue;
}

JavaScript

$(document).ready(function($){
    $('.test1').click(function (event) {
    if (event.target === this) {
    alert("test1 wurde geklickt");
    } else {
    alert("etwas anderes als test1 wurde geklickt")
    }
    });
   });