JSFiddle - React, Tailwind, and code Playground

by Timmy Willison

HTML

<script src="http://getfirebug.com/firebug-lite-debug.js"></script>
<p>
    Undelegate with class selector will not be executed correctly with jQuery 1.6.x, thus clicking on the button more then once will alert incorrectly multiple messages.
</p>

<div id="container">
        <button type="button" class="b">Click me twice</button>
</div>

JavaScript

function attach() {
    var $con = $("#container").undelegate()
        .delegate(".b", "click",
             function() {
                 console.log("click");
                 attach();
             }
        );
}    

attach();