JSFiddle - React, Tailwind, and code Playground

by lostinplace

HTML

<div id="el">Test</div>
<code>
    <span id="output"></span>
</code>

CSS

div { width: 200px; height: 200px; border: solid 1px red; }

JavaScript

$(function() {
    $("#el").click(function() {
        alert("click");
    });
    //$("#el").mouseover(function(){ alert("mouseover"); });
    debugger;
    var tmpEl;
    $.each($('*'), function(key, value) {
        tmpEl = $(value);
        if (tmpEl && tmpEl.data("events")&&tmpEl.data("events").click){
            output("click");
        }
    });


});


function output(text) {
    $("#output").html(function(i, h) {
        return h + text + "<br />";
    });
}