jeudi 20 octobre 2016

Vlookup like funtion in javascript

Actually I have made this on excel using Vlookup but now I am making this on webpage.

I have a input box where user will enter the value

<input class="text" type="text" name="rawScore" onchange="calcpercentile()">

and I have a span of where user can get the result

<span id="percentile"></span>

i have two arrays

var percentile = [10, 20, 30, 40, 50, 60, 70, 80, 90];
var rawScores = [1, 3, 5, 7, 10, 12, 18, 25, 27];

what code should i write that if I write so I get the

input       value
(rawScores)  (percentile)
1            10
2            20
3            30
4            40




Aucun commentaire:

Enregistrer un commentaire