Search code examples
jquerymaterialize

How to disable button with materialize?


I try to disable a button in materialize without delete the click event. But as you can see on this jsfiddle, I only get the visual effect. The click event is still launching.

I tried the following:

$('#btnOne').prop('disabled', true).addClass('disabled');

Is it a bug? Or am I doing something wrong?

EDIT : it seems there isn't the problem with the tag button


Solution

  • I did find the answer.

    a tags cannot be disabled by properties, button can be used instead.