I'm working on a website where multiple inputs need to be created dynamically using createElement
. Each input can have its own class, id, and other attributes.
The main objective is to automatically calculate the overall price whenever a user adds a new input (such as the amount of products). This should be done without requiring any additional clicks, with the calculation being based on the product price multiplied by the quantity entered in the input field.
While I could share the code, I believe an image would better illustrate the concept. You can view it here: https://i.stack.imgur.com/c33KZ.png
I am looking for guidance on how to implement this functionality using onchange
with getElementByTagName
. An example would be greatly appreciated. Thank you!