How can I enable/disable a button in MultiFile?

How can I enable/disable a button in MultiFile?

I've added a couple lines to jQuery.MultiFile.js to enable/disable my "Upload All" button, but they don't seem to work. Initially, disabled="disabled" in the page's HTML.

To disable, I added this around line 312 (after MultiFile.n--;)
  1. if (MultiFile.n == 0) {
          $("#btnUpload").attr("disabled", "disabled");
    }

To enable, I added this around line 347 (after MultiFile.n++;)
  1. $("#btnUpload").attr("disabled", "");
I also tried
  1. $("btnUpload").removeAttr("disabled");
This doesn't work. How can I disable the button when there are no files in the list and enable as long as there is at least one?

Thanks in advance!