Change part of name with Javascript and jQuery
<p>I have a few <code>select</code> elements on my page and i want to remove a part of the name.</p>

<p>Their name look something like this:</p>

<pre><code>ctl02$fieldname
</code></pre>

<p>The part that i want to remove is: <code>ctl02$</code>. So that it leaves me with <code>fieldname</code> only.</p>

<p>That part that i want to remove always starts with <code>ctl</code> then a two digit number ending with a <code>$</code>.</p>

<p>I tried it with the following code, but that didn't do the trick:</p>

<pre><code>$(".elements select").each(function() {
    this.setAttribute("name", this.getAttribute("name").replace(/ctl([0-9]+)\$$/, ""));
});
</code></pre>

<p>Anyone any idea how i can do this?</p>

<p>Here's a demo: <a href="http://tinkerbin.com/Klvx5qQF" rel="nofollow">http://tinkerbin.com/Klvx5qQF</a></p>
