Niccaman Posted September 18, 2009 Share Posted September 18, 2009 I have a script which gets an elements innerhtml, which is "08". I run parseInt on it, and it returns "0". Any ideas? Quote Link to comment Share on other sites More sharing options...
MadTechie Posted September 18, 2009 Share Posted September 18, 2009 when using parseInt () If the string begins with "0", the radix is 8 (octal). try setting the radix to base 10 ie parseInt("08",10); Quote Link to comment Share on other sites More sharing options...
Niccaman Posted September 18, 2009 Author Share Posted September 18, 2009 worked like a charm, tyvm Quote Link to comment Share on other sites More sharing options...
MadTechie Posted September 18, 2009 Share Posted September 18, 2009 Welcome I think I had that problem a long time again.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.