Menu
Hi
I got problem with parseInt function in javascript. parseInt works fine with digits 0-7 but when it is passed 8 or 9 it returns 0.
To solve this problem just pass the second parameter with the function which represents whether the first parameter to be converted to a octal,hexadecimal or decimal number.
Solution :
instead of using parseInt(“8”) or parseInt(“9”) use
parseInt(“8”,10) or parseInt(“9”,10) which will convert the first parameter to decimal integer ?