title: how to set value to specific object of array object in javasript
body: <p>I have to write inputbox inner a looping statement.
  let say I have 3 times loop</p>
  <pre><code>&lt;?php
      for($i = 0; i&lt;3;i++){
  ?&gt;
        &lt;input type=&quot;number&quot; id=&quot;numb&quot; onkeyup=&quot;getvalue(this.value)&quot;/&gt;
        &lt;span id=&quot;result&quot;&gt;&lt;/result&gt;
  &lt;?php
      }
  ?&gt;
  
  &lt;script&gt;
  function getvalue(val){
          var res= parseInt(val)*10;
          if(isNaN(res) == true){
              res = 0;
          }
          document.getElementById('result').value = res;
  
  }
  &lt;/script&gt;
  </code></pre>
  <p>the question is, how to set every value I type in inputbox only settbthe result
  inner span from its row index only</p>