How do I remove an event listener?

  • 0

    The button has a "click" event listener. But how to remove it if you still need to specify which function to remove? As I understand it, the function is anonymous.

    Full function code:
    BX.delegate = function (func, thisObject)
    		if (!func || !thisObject)
    			return func;
    		return function() {
    			var cur = BX.proxy_context;
    			BX.proxy_context = this;
    			var res = func.apply(thisObject, arguments);
    			BX.proxy_context = cur;
    			return res;

    I decided myself. In general, I just deleted the element and reinserted it.
    JavaScript Anonymous, Jan 24, 2019

  • 0 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!