How do we disabled buttons in javascript/jquery?
I tried:
$('#imgupload').disabled=true;
and
$('#imgupload').attr('disabled','disabled');
but neither works. Right after the above I put a console.log
line that works, so I know the surrounding code is fine.
The only thing that disables my button is if I hard code that it's disabled like this:
<input type='submit' id='imgupload' value='Upload' disabled=disabled />
But I need to enable and disable it dynamically on certain events so I can't use that.