Pass to javascript variable attribute from html input id="attribute"
<p>Input</p>

<pre><code>&lt;input type="text" value="" id="row1"&gt;
&lt;input type="text" value="" id="row2"&gt;
</code></pre>

<p>Need to get last character from row and pass it to javascript variable. Here is row1 and row2, need to get variables 1 and 2</p>

<p>I try to use this, but does not work</p>

<pre><code>$('[id^="row"]').each(function (index, row) {
var row = row.id.substring(3);
alert (row);//this is only to check if value exists (alert or not)
});
</code></pre>

<p>No alert at all. But need: on first iteration (.each) var row is 1, on second, - 2, etc. </p>

<p>Used this as example. The example works, but my code not</p>

<pre><code>$.each([52, 97], function(index, value) {
alert(index + ': ' + value);
});
</code></pre>
