JSFiddle - React, Tailwind, and code Playground

HTML

<div class="light"></div>

CSS

.light {
  width: 15px;
  height: 15px;
  background-color: red;
}

.light-click {
  background-color: blue;
}

JavaScript

$(document).on('click touchstart', '.light-click', function(event) {
  event.preventDefault();
  $(".light").addClass("turned-on");
  console.debug("aaa");
});
$(".light").wrap('<div class="light-click"></div>');
$(".light-click").width("40px").height("40px");