<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>
var a =15,b=15.15;
function isInteger(num) {
if (parseInt(num.toString()) == parseFloat(num.toString())) {
document.write(num+ "是整数")
}
else{
document.write(num + "是小数")
}
var result = false;
// 判断num是否是整数
}
isInteger(a);
isInteger(b);
</script>
</head>
<body>
</body>
</html>