Disabled button still listens to click event
Please off the click event
$('.btn-move-forward').off('click');
Change it to use prop()
instead.
$('.btn-move-forward').prop("disabled", true)
The disabled
property only applies to form elements. This means that unless the .btn-move-forward
element is a <button>
or <input type="button">
then the disabled
attribute will have no effect.
You can see a working example using a button
here:
$('.btn-move-forward').prop("disabled", true).click(function() {
console.log('Moving forward...');
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<button class="btn-move-forward">Move forward</button>