<!doctype html>
<html>
<head>
<title>修改网页标题</title>
<meta http-equiv="content-type" content="text/html;charset=gbk"/>
</head>
<body>
<input type="text" name="newTitle" id="newTitle" value="请输入新的标题"/>
<input type="button" value="修改标题" οnclick="changeTitle()">
<script type="text/javascript">
function changetitle()
{
var newTitle=document.getElementById("newTitle").value;
document.title=newTitle;
}
</script>
</body>
<html>
<head>
<title>修改网页标题</title>
<meta http-equiv="content-type" content="text/html;charset=gbk"/>
</head>
<body>
<input type="text" name="newTitle" id="newTitle" value="请输入新的标题"/>
<input type="button" value="修改标题" οnclick="changeTitle()">
<script type="text/javascript">
function changetitle()
{
var newTitle=document.getElementById("newTitle").value;
document.title=newTitle;
}
</script>
</body>
</html>
网页标题的属性是由document.title决定的,,,本程序中是通过获取输入框中的值,,然后通过title属性来修改网页标题