D
D
DeniSidorenko2020-04-21 10:33:31
JavaScript
DeniSidorenko, 2020-04-21 10:33:31

Is it possible to change the values ​​of the second js argument?

Good afternoon, there is such a markup

<button onclick="cart.add('8', '1')" class="button button-cart"><span>В корзину</span></button>

cart.add('8', '1')"
// 8 - id
// 1 - количество


Question. Is it possible through JS (there is a functionality for changing the quantity) to change the second argument of the function without touching the first

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2020-04-21
@DeniSidorenko

Keep the second argument in a variable.
"Functional change quantity" change the variable.
For example :

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question