I am trying to make a custom page for adding a bunch of related objects to one parent object. Specifically a bunch of web form fields to a parent web form. Please don't try to change this model because it's definitely not possible to change at this point.
My though is to have a single element for each web form field (the child object).
I would like to have a button to add a new blank row to fill in details for a new web form field like this;
<apex:commandButton value="Add another field" onclick="addRow();"/>
I am able to get the button to fire off some basic javascript. However I'm not sure how I can add a visualforce element ( in this case) to the DOM.
Is that even possible?
Can I add anything other than raw html to the DOM?