Skip to content
Advertisement

Disabling single button

I am having a problem of disabling single button

When I click to order for $10 it disables all buttons, and I only want the one which I have clicked to be disabled

JavaScript
JavaScript

Advertisement

Answer

Use $(this) which is the actual clicked item accessed by the selector

JavaScript
JavaScript

I would also delegate so you could add more buttons later

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement