In the object init, pass this. switch (tag) { case 'DIV': obj = new $.myDiv(); obj.init ($this);break;
jQuery.myDiv= function() { this.init = initDiv; this.doSomething = divFunction; this.actualObject; return this; function initDiv(obj) { this.acutalObject = obj; } function divFunction() { // call shared function $.sharedDoSomething(); } } jQuery.sharedDoSomething = function() { } Hope that make sense. On Jul 16, 4:38 pm, Harvey <scottandrewhar...@gmail.com> wrote: > I did think of that solution but where would I put functions shared by > myImg and myDiv that need access to the $this and tag variables?