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">
<p>
<span class="target btn btn-primary">double-click me</span>
<span class="trigger btn btn-inverse">click me to trigger double-click event manually</span>
</p>
<div class="log alert alert-block">log</div>
</div>
JavaScript
$(function(){
$('.target').dblclick(function() { // bind an event handler to the double-click event
$(this).toggleClass('btn-primary');
$('.log').append(' double-click-event');
});
$('.trigger').click(function() { // trigger the double-click event manually
$('.target').dblclick();
$('.log').append(' double-click-trigger');
});
});