Disabling buttons

A demonstration on how to disable buttons. I always get confused if the format should be "disabled=true" or just put "disabled"

by kshep92

HTML

<input type=button value="Click to disable" id=btn /> <input type=button value="Click to enable" id=enable />

JavaScript

$(document).ready(function() {

    $("#btn").click(function() {
    
        $(this).attr("disabled", "");
        
    });
    
    $("#enable").click(function() {
    
        $("#btn").removeAttr("disabled");
        
    });
});