JSFiddle - React, Tailwind, and code Playground
by webvitaly
HTML
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<div class="well">
<span class="target btn btn-primary">click me to toggle</span>
<span class="obj btn">click me obj</span>
<div class="log">log</div>
</div>
JavaScript
$(function() {
$('.target').click(function() {
$(this).toggleClass('btn-primary');
console.log(this);
$('.log').html('this: '+this);
});
var obj = {
doIt: function(e) {
console.log(this);
$('.log').html('this: '+$(this) );
}
}
$('.obj').on('click', $.proxy(obj.doIt, obj))
});