I have a div structure with input elements like this:
<div id="categories">
<div class="elements">
<input type="text" name="v1" class="myclass" />
<input type="text" name="v2" class="myclass" />
<input type="text" name="v3" class="myclass" />
</div>
</div>
<a href="" id="add_newitem">Add New Item</a>
I clone the div 'elements' and put that back into the div 'categories' like so:
$("#add_newitemr").click(function() {
$('.elements').clone().appendTo('#categories');
});
This works fine, except that it also clones the values that were entered in the textfields. How can i clear the values of the newly cloned textfields??