Playing with jQuery proxy

by markallgood

HTML

<p id="testp">Test Paragraph</p>

CSS

.red { color:red; font-weight:bold; }

JavaScript

var fn = function() {
    this.addClass("red");
}
$(function() {
    $.proxy(fn, $("p#testp"))();
});