I've managed to cut and paste together the following script:
It basically takes the value of the input box and inserts into another generated element along with a link that should delete the item when clicked. Now I need to each field and X to be surrounded by a div so that the output would be like below
<div class="regItm">
<input properties.../><a properties...>X</a>
</div>
<div class="regItm">
<input properties.../><a properties...>X</a>
</div>
...
...