【发布时间】:2011-04-26 03:47:03
【问题描述】:
我接到了一个任务... "计算字符串 "tx_val" 中包含 3、4、5 或 6 个字符的单词数 在一行中显示这四个计数,用逗号分隔"
我一直在尝试多个不同的循环语句,但我似乎无法得到正确的答案。
这是给我的代码:
<html>
<head>
<script language="javascript">
<!--
function fred()
{
var tx_val=document.alice.tx.value;
len_tx=tx_val.length
-->
</script>
</head>
<body>
<form name="alice">
<b>Assignment #1 Javascript</b>
<p>
The text box below is named "tx". The form is named "alice".
<p>
<input type="text" name="tx" formname="alice" size="50" value="the quick brown fox jumped over the lazy dogs back">
</form>
【问题讨论】:
标签: javascript string