SOURCE

console 命令行工具 X clear

                    
>
console
<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>第一段JavaScript</title> 
</head>
<body>
<h1>我的第一段 JavaScript</h1>
<p>请输入数字。如果输入值是数字,浏览器会弹出提示框。</p>
<input id="demo" type="text">
<script>
function myFunction()
{
	var x=document.getElementById("demo").value;
	if(x!=""&&!isNaN(x))
	{
		alert("是数字");
	}
}
</script>
<button type="button" onclick="myFunction()">点击这里</button>
	
</body>
</html>