jquery change value of textbox by using a string
<p>I am trying to implement and undo feature in my webpage. It is a table full of editable texboxes so coming up with an id was hard. I decide to make an id name based of the table inforamtion. Here is an id for example:</p>

<pre><code> HW3=:25626=:10000
</code></pre>

<p>HW3 is the header, 25626 is the id column for the row and 10000 references this table. For the undo feature i get the id by using</p>

<pre><code> $(this).attr('id);
</code></pre>

<p>and this funciton is called based on the event focus or click that is why 'this' works. I take the current value and add it to the end like</p>

<pre><code> $(this).attr('id)+":="+old_value;
</code></pre>

<p>This is done becuase the id name is seperated by "=:" so i can do two splits to get this data back in parts. Might not be best I understand.</p>

<p>The problem i am having is when I try to pull out the id and put it back as an element I get the error:</p>

<pre><code> Uncaught Error: Syntax error, unrecognized expression: #HW3=:25626=:10000 
</code></pre>

<p>I am trying to do:</p>

<pre><code>  var s = "#"+temp[0];
  var element = $(s);
</code></pre>

<p>temp[0] is = to HW3=:25626=:10000. It is the second line throwing this error.</p>

<p>IMPORTANT!!! The table that has the id that I am using is not created in the begining. JQuery calls a method that builds it after page loads. This method can not be access until after the table is created. I understand that you can not bind events to elements until after they load but I'm not sure if the is that same case since i will never try to undo on a textbox that is not present. After all it had to be present to be inserted into the Undo object already.</p>

<p>Any help is appreciated. </p>
