Global.parseInt() : parseInt : Global JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Global » parseInt »

 

Global.parseInt()











Syntax








parseInt(string, radix)
    parseInt(string)



The parseInt() method is used to convert a string to an integer.

It can take string input with an optional radix input.

The radix input represents the base of the number in the string.












<html>
    <body>
    <script language="JavaScript">
    <!--
    document.write("The string 8 converted to an integer is: ");
    document.write(parseInt("8""<br>");
    -->
    </script>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Global
» parseInt