manipulating dynamically created form elements without losing their values with jQuery
<p>I want to do a search and replace on a complex bit of dynamically created form. It's as simple as finding all the instances of one string and replacing them with another, made more complicated by the fact there are 11 instances per bit of form and make up only parts of various attributes. </p>

<p>Examples of the kind of thing I'm working with (it's the '001' bit I'm searching and replacing):</p>

<pre><code>&lt;div id="step_title:001|title"&gt;
&lt;label for="step_title:001|title|field"&gt;
&lt;input id="step_title:001|title|field" name="step_title:001|title|field"/&gt;
</code></pre>

<p>I had thought something like this would do the trick:</p>

<pre><code>$(this).html($(this).html().replace('old string', 'new string'));
</code></pre>

<p>However because the bit of form is dynamically added the form data is lost every time I perform this action. I tried using the .clone() function which seems to preserve the data, but that doesn't allow you to manipulate the object. I also tried performing the search and replace directly onto the containing object, but I guess .replace() only works on strings. </p>
