Enable/Disable buttons in jQuery -


i have function i'm enabling or disabling buttons.

  var managebuttons = function(status) {       if(status === 'inactive') {           $("input[type='submit'], button").addclass('inactive').attr('disabled', true);       }       else {           $("input[type='submit'], button").removeclass('inactive').removeattr('disabled');       }        }; 

instead of passing status 'inactive' or 'active', want pass boolean values true & false.

i want managebuttons(true) or managebuttons(false) instead of managebuttons('active') or managebuttons('inactive'). how can that?? on please?? or suggest better approach??

you use:

var managebuttons = function(status) {     $("input[type='submit'], button").prop('disabled', status); }; 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -