Javascript examples for String Operation:String Convert
Use parseInt function to convert string to int
<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>