上菜:

<html>
<body>

<input id="xxx" />

<script>
function fun()
{
	var x = document.getElementById("xxx").value;
	if("" == x || isNaN(x))
	{
		alert("no");
	}
	else
	{
		alert("yes");
	}
}
</script>

<button οnclick="fun()">judge</button>

</body>
</html>



本文转载:CSDN博客