views:

38

answers:

1

I have to disable button when page is loading ,,after full loading page i a have to enable using jquery or javascript how to do?

+2  A: 

Disable any button from the beginning:

<input type="button" disabled="disabled" />

And add the enable to window ready function

$(document).ready(
    function(){
        $("input[type=button]", "<input[type=submit]", "input[type=reset]").each( //add more selector here if you want
            function(){
                if($(this).attr("disabled"))
                    $(this).attr("disabled", false); //enable button again
            }
        );
    }
);
Bang Dao
Shouldn't it be $(window).load ?
Charlie boy
Thank. I use $(document).ready instead of $(window).load
Bang Dao