拿到input框里输入的数字,进行比较
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<input id="zyczje" type="text" placeholder="请输入住院充值金额" />
</body>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script>
$('#zyczje').keyup(function(){
console.log(typeof $(this).val());
console.log(typeof Number($(this).val()));
if(0 < Number($(this).val()) && Number($(this).val()) < 10000) {
console.log('输入正确')
}else{
console.log('输入金额太低或者超过1万')
}
})
</script>

更多精彩