Javascript高手请帮一下忙

来源:百度知道 编辑:UC知道 时间:2024/06/07 17:53:57
<script>
function tolower()
{
str1=doucment.form1.abc.value;
alert(str1.toUpperCase())
}
function toupper()
{
str1=doucment.form1.abc.value;
alert(str1.toLowerCase())
}
</script>
<form name=form1>
<table align=center border>
<tr>
<td>请输入单词:<input name=abc type=text></td></tr>
<tr align=center>
<td><input type=button value=大转小 onclick="toupper()">
<input type=button value=小转大 onclick="tolower()">
</tr>
</table>
</form>
</script>
大小写转换的例子,始终不能转,检查很多次了,没发现错在哪里,请高手帮帮小弟.

<script>
function tolower()
{
str1=window.document.form1.abc.value;
alert(str1.toUpperCase())
}
function toupper()
{
str1=window.document.form1.abc.value;
alert(str1.toLowerCase())
}
</script>
<form name="form1">
<table align=center border>
<tr>
<td>请输入单词:<input name=abc type=text></td></tr>
<tr align=center>
<td><input type=button value=大转小 onclick="toupper()">
<input type=button value=小转大 onclick="tolower()">
</tr>
</table>
</form>
这是正确答案,自已看吧

</tr>
</table>
</form>

</table>
</form>
</script

你的<script></script>不配对,好好检查一下吧。

同意

最后三句话:
</table>
</form>
</script>
改成
</table>
<