lets say i’ve a form and in this form i would like to duplicate properties elements. now every property element is a div which contains some input elements. every time the user click on a button “add properties” i would like it to create another instance of this properties element
the question is where should i store these pre-made and yet to be shown to the user elements, in a way it would be easy to later modify it?
i’m using JS with jquery.
Will at least one property element already exist on the page?
If so, simply select it, clone it and store it for later use.
Then later you can make copies of it.
If your element doesn’t exist on the page yet. You can still put it on the page in a div that isn’t displayed and do the same strategy as above. Or use a “template” format such as jQuery templates.