Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
  <title>Test Page</title>
<style>
  body {
    font-family: sans-serif;
  }
</style>
</head>
<body>
  <label>String: <input type="text" id="theString"></label>
  <br/>
  <label>Output: <label type="text" id="output"></label>
  <br><input type="button" id="theButton" onclick="regIsNumber(this);" value="Check">
  <div id="results"></div>
    <script>
      
function isNormalInteger(str) {
  return /^\+?(0|[1-9]\d*)$/.test(str.val());
}
      
function regIsNumber(value) {
  var isValid = isNormalInteger(value);
alert(isValid);
  console.log(isValid);
  return isValid;
}
    </script>
    </body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers