Add and Remove HTML elements dynamically with Javascript

Today I have work in magento and work was save multiple dates in an attribute witout entering multiple values in one field. and need to provide multiple text box ( with date icon to select date )where user can select date and submit the form. On the submit time I have to fill all text boxes value in a single attribute.
And this was good news for me that I have written code for this. Here I am providing basic code to create multiple text fields (elements) by javascript.
Insert below code in the head tag:


Now, Put below code inside the body tag and save file and run on browser.

+ Add more text box

Comments

4 responses to “Add and Remove HTML elements dynamically with Javascript”

Leave a Reply

Your email address will not be published. Required fields are marked *

*