“Does replacing variables in jQuery keep using the prior value?”
I have the next input that shows "buy" value by default <input class="myVar" data-buy="50000" data-sell="80000" value="5000" /> <button id="change">CHANGE PRICES</button> <button id="toggle">TOGGLE</button> I click on "#change" in order to increase the amount of "buy" and "sell" $(document).on("click", #change", function(){ $(".myVar").attr("data-buy",6000);…