JSFiddle - React, Tailwind, and code Playground

by Valentin Radulescu

HTML

<div class="someclass"></div>
<div class="otherclass"></div>

CSS

.someclass, .otherclass{
    display: inline-block;
    width: 300px;
    height: 200px;
}

.someclass{
    background-color: red;
}
.otherclass{
    background-color: green;
}

JavaScript

$(document).on('click','.someclass',function(){
   $('.otherclass').trigger('keyup',{aField:'my data'});
});

$(document).on('keyup','.otherclass',function(e, obj){
   console.log(obj); // and to have printed 'my data'
});