Parsing an Int from a string in javascript
<p>In javascript, what is the best way to parse an INT from a string which starts with a letter (such as "test[123]")?  I need something that will work for the example below.</p>

<p>My JS:</p>

<pre><code>$(document).ready(function() {

    $(':input').change( function() {
     id = parseInt($(this).attr("id"));  //fails for the data below
     alert(id);
    });
}
</code></pre>

<p>My generated HTML:</p>

<pre><code>&lt;select id="attribute[123]"&gt;
&lt;!-- various options --&gt;
&lt;/select&gt;
&lt;select id="attribute[456]"&gt;
&lt;!-- various options --&gt;
&lt;/select&gt;
</code></pre>

<p>Thank you!</p>
