Skip to content
Advertisement

Jquery remove div of previous selection and append current selection to allow only one selection per row using buttons

I have The following code with buttons that append selections to the “cart” div on click

In The first Script, Its function is to allow only one selection per row whenever multiple buttons in the same row are clicked.

In the second script, its function is to append the selections to the “cart” div and remove if choice has been unselected.

The problem comes in when I click on multiple buttons in the same row, the first script seems to work just fine as in it de-actives the previous one and activates the current button clicked, the second script is supposed to remove the previous selection in the same row and update the new selection for the current button that is active

How do I get to edit my second script to cater for this functionality?

JavaScript

In this script, Its function is to allow only one selection per row whenever multiple buttons in the same row are clicked.

JavaScript

In this script, its function is to append the selections to the “cart” div and remove if choice has been unselected.

its supposed to remove the previous selection in the same row and append or update the new selection for the current button that is active

JavaScript
JavaScript

Advertisement

Answer

The set timeout was causing the issue. I adjusted it in the following code:

When changing the stake it is also updating now I added a small line.

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