Issue with changing an attribute with jquery
<p>I'm having an issue with changing the attribute for an id and can't seem to figure out what I'm doing wrong. I guess it doesn't help that I'm new to this also.</p>

<p>I have a function that tests to make sure that I am pulling the correct id from the row in my form that I have dynamically created. It goes something like this:</p>

<pre><code>myFunction() {
  var id = $(id).attr("id");
  alert("This is my id " + id);
}
</code></pre>

<p>This works with no problem and when I click the button assigned to alert me of my id it will give me the id of the dynamic row in my form. The issue is now when I try to change the id with this:</p>

<pre><code>changeId() {
  var newId = $(id).attr("id", "x");
  alert("This is my new id " + newId);
}
</code></pre>

<p>What happens in this case is that it will alert saying "This is my new id [object Object]" instead of giving me the new id. Any suggestions? I'd really appreciate any help with this.</p>
