JSFiddle - React, Tailwind, and code Playground
HTML
<p class="test">click me get value</p>
JavaScript
$(document).ready(function(){
test();
$(window).resize(function(){
test();
});
});
function test() {
var t = $(window).width() - 74;
console.log('one ' + t);
$('.test').off('click');
$('.test').on('click', {t: t}, getInfo);
}
function getInfo(event) {
var l = event.data.t
console.log('two ' +l)
}