JavaScript Tutorial/Global/parseInt
Global.parseInt()
Syntax
parseInt(string, radix)
parseInt(string)
Parse binary number
<html>
<body>
<script language="JavaScript">
<!--
document.write("The binary string 101101 converted to an integer is: ");
document.write(parseInt("101101", 2) + "<br>");
-->
</script>
</body>
</html>
Parse hexidecimal string
<html>
<body>
<script language="JavaScript">
<!--
document.write("The hexidecimal string FA832B converted to an integer is: ");
document.write(parseInt("FA832B", 16) + "<br>");
-->
</script>
</body>
</html>