Core idea: You add new functionality to a control class by defining functions on the class’ prototype.

As in normal JavaScript, you give instances of a control class access to a new function by extending the class’ JavaScript prototype. There are several ways to do this, but the easiest is to include functions as values in the object passed to Control.sub(). These functions will be copied over to the new class’ prototype, making them available to all instances of the control class (as well as any subclasses of that class you might define later).

If you select a control’s top element out of the DOM to obtain a general jQuery object, you’ll need to cast that object to the more specific class before you can invoke the class’ function.

The demo code includes a “highlight:” key with a function value. That function will be copied to UserTile.prototype.highlight(), where it can then be invoked on any UserTile instances. The demo creates three instances of the UserTile class, and invokes highlight() on the second instance.

For now, the highlight() function has no effect, and simply returns the control itself. (Returning “this” permits jQuery-style function chaining.)

Your goal: Change the body of the highlight function so that it does something visually interesting to the control. A simple example would be to use the jQuery css() function to set the background of the control to some noticeable color. Be sure that the highlight function continues to return “this” so that the function can be chained.