<meta charset="utf-8"/& gt;
<style type="text/CSS" & gt;
Div {
text-align: center; Margin: 20 px auto; The line - height: 1.5;
Border: 18 px groove # 66 ff66; Width: 560 px; Height: 260 px; font-weight: bold;
}
The form {
Margin: 20 px auto; Padding: 5 px;
}
</style>
<script SRC="https://bbs.csdn.net/topics/sum.js" type="text/javascript" charset="utf-8" & gt; </script>
The function show () {
Var n11=parseFloat ($(" start_num "). The value).//get the data and into a floating point number
Var n22=parseFloat ($(" end_num "). The value).
If (n11 & gt; 0 & & N22 & gt; 0)//input data must be greater than 0
{
If (n11 & gt;=n22)
{alert (" starting number must be less than end, heavy lose, please!" );
$(" start_num "). The value="";//to empty text field
$(" end_num "). The value="";//to empty text field
$(" start_num "). The focus ();//text field gains focus
}
The else {//backfill accumulation and text box
$(" sum "). value=https://bbs.csdn.net/topics/sum (n11, n22);
}
}
The else {
Alert (" please input data!" );
$(" start_num "). The focus ();//text field gains focus
}
}
</script>
<body>