You are here: irt.org | FAQ | JavaScript | Form | Q1740 [ previous next ]
Use a Regular Expression:
<html>
<body>
<script language="JavaScript"><!--
var temp = prompt('Enter a number','23408fn2fy28fh398f928');
temp = temp.replace(/[^0-9]/g,'');
alert(temp);
//--></script>
</body>
</html>