I need this for dynamically use. I have 2 associated arrays:
Var $some = [1, 2, 3];
Var $other = [a, b, c];
a, b, c are some html ids and 1, 2, 3 are their values. I want something like this on trigger:
$'#a').attr('max', //b+c val(2+3)
$'#b').attr('max', //a+c val(1+3)
$'#c').attr('max', //a+b val(1+2)
I ve searched here get prev and next items in array about finding next elements in array, and I think would be usefull a loop that itinerate elements a (then b then c) with its values and for each one execute a code like: sum next elements to them. Substracting element value after sumed won't work pripperly because I want that script on some ranges change... So...my question would be: how can I sum elements itinerated from a loop? I think that would be the key to solve this because I can loop it 2 times in this example and would stop without started element...