Class: Class.ToElement
Adds the toElement method on a class. This allows dollar to return the element when passed an instance of the class.
Tutorial/Demo
Example
var Widget = new Class({ Implements: Class.ToElement, initialize: function(element){ this.element = $(element): } }); var myWidget = new Widget($('example')); $('example') == $(myWidget);