JSFiddle - React, Tailwind, and code Playground
by Shrikrishna Gupta
HTML
<link rel="stylesheet" href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css">
<input type="submit" class="btn" value="My Input Submit"/>
<input type="button" class="btn" value="My Input Button"/>
<button class="btn">My Button</button>
<a href="http://example.com" class="btn">My Link</a>
CSS
a.disabled { text-decoration:none; color:#bbb; }
JavaScript
$(function() {
jQuery.fn.extend({
disable: function(state) {
return this.each(function() {
var $this = $(this);
if($this.is('input, button'))
this.disabled = state;
else
$this.toggleClass('disabled', state);
});
}
});
$('input[type="submit"], input[type="button"], button, a').disable(true);
$('body').on('click', 'a.disabled', function(event) {
event.preventDefault();
});
});