document.form1.text1.value=document.title;
注意你用的是全角分号。
另外,赋值写反了。
<html>
<head>
<title>
夜是寂寞的心
</title>
<script language="JavaScript">
<!--
function changeText()
{
document.title = document.form1.text1.value;
}
//-->
</script>
</head>
<body>
<a href="javascript:alert('夜是寂寞的心')">寂寞如水 </a>
<form name=form1>
改变文本内容: <input type="text" name="text1" value="沉默大多数"> </input>
<input type="button" name="button1" value="改变" onclick="changeText()"> </input>
</form>
</body>
</html>
注意你用的是全角分号。
另外,赋值写反了。
<html>
<head>
<title>
夜是寂寞的心
</title>
<script language="JavaScript">
<!--
function changeText()
{
document.title = document.form1.text1.value;
}
//-->
</script>
</head>
<body>
<a href="javascript:alert('夜是寂寞的心')">寂寞如水 </a>
<form name=form1>
改变文本内容: <input type="text" name="text1" value="沉默大多数"> </input>
<input type="button" name="button1" value="改变" onclick="changeText()"> </input>
</form>
</body>
</html>
卜咯米WEB设计
<head>
<title>
夜是寂寞的心
</title>
<script language="JavaScript">
<!--
function changeText()
{
document.form1.text1.value =document.title ;
}
//-->
</script>
</head>
<body>
<a href="javascript:alert('夜是寂寞的心')">寂寞如水 </a>
<form name=form1>
改变文本内容: <input type="text" name="text1" value="沉默大多数"> </input>
<input type="button" name="button1" value="改变" onclick="changeText()"> </input>
</form>
</body>
</html>