Use parseInt function to convert string to int - Javascript String Operation

Javascript examples for String Operation:String Convert

Description

Use parseInt function to convert string to int

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from w w w  .j ava2 s  .  c om
var elementMouseIsOver = "10";
elementMouseIsOver = parseInt(elementMouseIsOver);
console.log(elementMouseIsOver);
console.log(typeof(elementMouseIsOver));
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials