Answer the question
In order to leave comments, you need to log in
How to manage multiple house elements?
Good afternoon everyone, a theoretical question.
Here, for example, I implement a calculator (Conditionally which counts 2 + 2) It takes the operation from one input and when it does not matter what action, let change do the calculations.
I made up, described some class that does it.
What I want to do next:
~When I click on the (conditionally) "Add Calculator" button, I should have the same calculator on the page and do the same calculations. I need to do this endlessly, and, on top of all this, I should have another class that will sum up the results of all calculators (This is a very conditional example, but this is exactly the problem I am currently solving for practice).
I need to understand on elementary things how to implement this in native js.
Answer the question
In order to leave comments, you need to log in
Have you heard of arrays? What prevents you from creating inputs like this:
<input name="myCalc[0][firstValue]" >
<input name="myCalc[0][secondValue]" >
<input name="myCalc[1][firstValue]" >
<input name="myCalc[1][secondValue]" >
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question