JSFiddle - React, Tailwind, and code Playground

by Fu-Ching Hsiao

HTML

<h3>Object event with Proxy Function</h3>

<input type="button" name="btn" value="Proxy" id="btn" />

JavaScript

var evnet = {
    text: function () {
        console.log("this is click");
    },
    dblclick: function () {
        console.log("this is double click");
        $('#btn').off("click");
    }
};
$('#btn').on("click", $.proxy(evnet, "text"));
$('#btn').on("dblclick", $.proxy(evnet, "dblclick"));