JSFiddle - React, Tailwind, and code Playground

by Mark Coleman

HTML

<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css">
<button>A button element</button>

<span>Restore Button</span>

JavaScript

$("button").button().click(function(event) {
    $("body").append("<h1>A Clicked</h1>");
    var events = $(this).data("events");
    $(this).data("oldEvent", events.click[0]);
    $(this).button("disable").unbind('click', events.click[0]);
});

$("span").click(function(){
    var oldClick = $("button").data("oldEvent");
    $("button").button("enable").bind("click", oldClick.handler);
});