Hi can anyone please help me solve this problem?
Using branch condition statement if n<=30, use onclick event to call the function and display the calculation result;
otherwise, display the message: “Please input a number between 0 to 30!”
Many thanks in advance
<head><title></title>
<script language=javascript type=text/javascript>
<!--
function calculation() {
var yourNumber = window.prompt("Enter a number","");
if (yourNumber == "n<=30"){
alert(result);
}else{
document.write("Please input a number between 0 to 30!<BR>");
}
//--->
</script>
</head>
<body>
<form>
Input:<INPUT TYPE=TEXT NAME="inpt" SIZE=20 >
<BR><BR><input type="button" value="Calculate" onClick="calculation()">
</form>
</body>
</html>
Submit Your Article
Forum Rules

Reply With Quote

