JSFiddle - React, Tailwind, and code Playground

by BeNdErR

HTML

<button id="btn">Trigger vameh</button>
<button id="btn2">Trigger vamehns</button>
<div id="vameh">
  VAMEH
</div>
<div id="vamehns">
  VAMEHNS
</div>

JavaScript

$("#vameh").on("culocane", function() {
var self = this;
	$(self).css("background", "red");
  setTimeout(function(){
  	$(self).css("background", "none")
  }, 1000)
});
$("#vamehns").on("culocane.ns", function() {
var self = this;
	$(self).css("background", "red");
  setTimeout(function(){
  	$(self).css("background", "none")
  }, 1000)
});
$("#btn").on("click", function(){
	$("#vameh").trigger("culocane");
  $("#vamehns").trigger("culocane");
})
$("#btn2").on("click", function(){
	$("#vameh").trigger("culocane.ns");
  $("#vamehns").trigger("culocane.ns");
})