<html>
<head>
<title>String</title>
<script type = "text/javascript">
<!--
function splitButtonPressed()
{
var inputString = document.getElementById( "inputVal" ).value;
var inputString2 = document.getElementById( "inputVal2" ).value=inputString*0.09+200;
document.getElementById( "output" ).value =
} // end function splitButtonPressed
// -->
</script>
</head>
<body>
<form action = "">
<p>Enter sales amount<br />
<input id = "inputVal" type = "text" size = "40" />
<input type = "button" value = "Submit"
onclick = "splitButtonPressed()" /></p>
<input id = "inputVal2" type = "text" size = "40" />
<p><textarea id = "output" rows = "20" cols = "60">
</textarea></p> </form>
</body>
</html>
只差textarea,
textarea要求輸出以下:
$200-399 0
$400-599 0
$600-799 0
$800-999 0
$1000 and over 0
如果"inputVal2"輸出($610)是$600-799的範圍,0變1,一定用array完成
請求高手解決~
<head>
<title>String</title>
<script type = "text/javascript">
<!--
function splitButtonPressed()
{
var inputString = document.getElementById( "inputVal" ).value;
var inputString2 = document.getElementById( "inputVal2" ).value=inputString*0.09+200;
document.getElementById( "output" ).value =
} // end function splitButtonPressed
// -->
</script>
</head>
<body>
<form action = "">
<p>Enter sales amount<br />
<input id = "inputVal" type = "text" size = "40" />
<input type = "button" value = "Submit"
onclick = "splitButtonPressed()" /></p>
<input id = "inputVal2" type = "text" size = "40" />
<p><textarea id = "output" rows = "20" cols = "60">
</textarea></p> </form>
</body>
</html>
只差textarea,
textarea要求輸出以下:
$200-399 0
$400-599 0
$600-799 0
$800-999 0
$1000 and over 0
如果"inputVal2"輸出($610)是$600-799的範圍,0變1,一定用array完成
請求高手解決~
{
case 2: array[0]++;
break;
case 3:array[1]++;
break;
case 4:array[2]++;
break;
case 5:array[3]++;
break;
case 6:array[4]++;
break;
case 7:array[5]++;
break;
case 8:array[6]++;
break;
case 9:array[7]++;
break;
default:array[8]++;
}