Answer the question
In order to leave comments, you need to log in
The program for calculating money went into a stupor?
Good afternoon, I just started learning js - tell me how to finish the program. In appearance, the idea is simple, but I don’t understand how to complete it: the user entered a number in the field / the program saved it / then, when another number was entered, a new one was added to the saved value, and so on .....
https://codepen.io/shnopik87/pen /XZLOmp
Thank you)
Answer the question
In order to leave comments, you need to log in
const result = document.querySelector(".money-block__value");
const field = document.querySelector(".field");
document.querySelector(".btn").addEventListener("click", () => {
result.textContent = (+result.textContent + +field.value);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question