jquery calculate BMI
<p>I stuck to this problem. I want to calculate body BMI.</p>

<p>My HTML - every row <code>&lt;tr&gt;</code> is created dynamically by PHP.</p>

<pre><code>     &lt;tbody&gt;        
     &lt;tr id="person_bmi"&gt;
        &lt;td&gt;Jack&lt;/td&gt;
        &lt;td&gt;&lt;input name="weight" type="text" class="span1" id="weight" maxlength="5"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input name="height" type="text" class="span1" id="height" maxlength="5"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input name="bmi" type="text" class="span1" id="bmi" readonly&gt;&lt;/td&gt;       
      &lt;/tr&gt;

    &lt;tr id="person_bmi"&gt;
        &lt;td&gt;Michael&lt;/td&gt;
        &lt;td&gt;&lt;input name="weight" type="text" class="span1" id="weight" maxlength="5"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input name="height" type="text" class="span1" id="height" maxlength="5"&gt;&lt;/td&gt;
        &lt;td&gt;&lt;input name="bmi" type="text" class="span1" id="bmi" readonly&gt;&lt;/td&gt;       
      &lt;/tr&gt;

      //and so on...
&lt;/tbody&gt;
</code></pre>

<p>What I try to achieve is every person <code>Jack</code>, <code>Michael</code>, <code>so on..</code> will have their own BMI values in <code>#bmi</code> textfield after calculated their own <code>$weight/($height*100/$height*100)</code> value. I try to create my own code but its not make sense..</p>

<pre><code>$("#weight, #height").keyup(function(){
    var $weight= $("#weight").val();
    var $height= $("#height").val();
    var $bmi = $weight/($height/100*$height/100);

    $("#bmi").val(parseInt($bmi));
});
</code></pre>

<p>Can someone show me the way? Thanks</p>
