I can not beautifully describe, so it’s better to show with an example.
In the example below, when this event fires, it will refer to the DOM element that triggered the event.
How, in this case, to access the object without knowing its name.

object = { method : function(){ this } }; myObject = Object.create(object); $('someone').click(myObject.method) 
  • As a result, I found a way out in the form of such a construction: element.bind ('click', {object: this}, function (event) {object = event.data.object; object.changeSlide (this);}); - Yegor Nikitenok

2 answers 2

 object = { method : function(obj){ console.log($(obj).attr('class')); } }; myObject = Object.create(object); $('.class').bind('click',function(){myObject.method(this);}); 

    You can bind method to a specific object by calling bind :

     object = { method : function(){ this } }; myObject = Object.create(object); $('someone').click(myObject.method.bind(myObject));