I\'m using jQuery to add/remove input fields.
-
Try storing the element as a string. Here is a site that gives a nice implementation getting the outerHTML of an element. http://www.yelotofu.com/2008/08/jquery-outerhtml/
jQuery.fn.outerHTML = function(s) {
return (s) ? this.before(s).remove()
: jQuery("<p>").append(this.eq(0).clone()).html();
}
Store that string and then reinsert the element using the appropriate jQuery method.