Theres something very basic about javascript arrays I'm missing.
The value of unit[i].value is 17.00
and value of the qty[i].value is 5
and I put these values into an array: myarray[unit[i].value]=qty[i].value;
I accessed the qty[i].value by putting it into <div id='test2>:
document.getEle mentById('test2 ').innerHTML+=m yarray[unit[i].value];
and it says 5
so far so good.
but this is undefined:
document.getEle mentById('test2 ').innerHTML+=m yarray[17.00];
why ?
The value of unit[i].value is 17.00
and value of the qty[i].value is 5
and I put these values into an array: myarray[unit[i].value]=qty[i].value;
I accessed the qty[i].value by putting it into <div id='test2>:
document.getEle mentById('test2 ').innerHTML+=m yarray[unit[i].value];
and it says 5
so far so good.
but this is undefined:
document.getEle mentById('test2 ').innerHTML+=m yarray[17.00];
why ?
Comment