展开全部
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<script>
function check() {
var num1=document.getElementById("a").value;
var num2=document.getElementById("b").value;
if(isNaN(num1)||isNaN(num2)){
alert("请输入数字");
return;
}
if(parseInt(num2)>parseInt(num1)){
alert(num2);
} else{
alert(num1) ;
}
}
</script>
</head>
<body>
<input type="text" id="a">
<input type="text" id="b">
<button onclick="check()" >判断</button>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<script>
function check() {
var num1=document.getElementById("a").value;
var num2=document.getElementById("b").value;
if(isNaN(num1)||isNaN(num2)){
alert("请输入数字");
return;
}
if(parseInt(num2)>parseInt(num1)){
alert(num2);
} else{
alert(num1) ;
}
}
</script>
</head>
<body>
<input type="text" id="a">
<input type="text" id="b">
<button onclick="check()" >判断</button>
</body>
</html>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |