on Click of link a modal window opens or div with textarea inside it opens and values transferring to main textarea

on Click of link a modal window opens or div with textarea inside it opens and values transferring to main textarea

My try is quite Complex This:

1. Textarea Box above with unique name suppose values_#dynamic#
2. Now here is the link Edit, which has a unique id names as edit_#dynamic# and it is declared inside a Span tag, a Div tag can also be used, but just for sake i used span.
3. Now clicking on the Edit will open a POPUP just underneath the link and values it will start entring, it will 3 buttons, Save will close the popup, value get tranferred to the textarea main one and the popup will close.
4. Other buttons are rest & close which will do a cancel and resting,
5. The structure of the dynamic can be like this


Textarea
   Level 1 Textarea
         Level2 Textarea
               Level3 textarea

and under each textarea, there will be a link, which will open its own popup and fll values inside which will be transferred to the main textarea on its closure, it is dynamic purely