怎么动态改变HTM文件中TITLE的值

lansajf 2003-10-16 12:10:54
怎么动态改变HTM文件中TITLE(代码第三行)的值,
我是想了好久都没有想出来,不知道哪位高人能解开这个迷
<html>
<head>
<title>lansa</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<div align="center">
<input type="button" name="Button" value="Button" onclick="title.innerText='大海'">
<input name="wwwq" type="text" id="wwwq" value="qqqq">
</div>
</body>
</html>
...全文
80 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangking 2003-10-16
  • 打赏
  • 举报
回复
<script language="javascript">
this.title="大海的字符串";
</script>
lansajf 2003-10-16
  • 打赏
  • 举报
回复
----main.htm------------
<html>
<head>
<title>lansa</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#ff0000">
<iframe src="Untitled-1.htm" width="100%"></iframe>
</body>
</html>
----Untitled-1.htm------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Folders</title>

</head>
<body >
<input type="button" name="Button" value="Button" onclick="parent.title='大海'">
</body>
</html>

如果我要通过Untitled-1.htm文件中的onclick事件改变main.htm文件的title的值,怎么写代码?
kingdomzhf 2003-10-16
  • 打赏
  • 举报
回复
<html>
<head>
<title>lansa</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<div align="center">
<input type="button" name="Button" value="Button" onclick="document.title='大海'">
<input name="wwwq" type="text" id="wwwq" value="qqqq">
</div>
</body>
</html>
purexu 2003-10-16
  • 打赏
  • 举报
回复
<input type="button" name="Button" value="Button" onclick="document.title.='大海'">
nolonely 2003-10-16
  • 打赏
  • 举报
回复
onclick="document.title='大海'">
lansajf 2003-10-16
  • 打赏
  • 举报
回复
不会吧!难到了还要我另外写张帖子???

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧