typeof() 函数可以识别一个变量的数据类型,比如:
[code=javascript]<script type="text/javascript">
var number = prompt("please enter a number", "");
var today = new Date();
document.write( typeof( number ) );
document.write ( "<br \>" );
var val = 100;
document.write( typeof( val ) );