<html>
<head>
<title>改变网页标题</title>
<script language="javascript">
function ChangeTitle()
{
var strTitle=this.InpTitle.value;
if(strTitle=="")
{
alert('标题不能为空');
return false;
}
document.title=strTitle;//这里改变标题
alert('当前网页标题为'+document.title);
}
</script>
</head>
<body>
<input type="text" name="InpTitle" >请输入标题
<input onClick="ChangeTitle();" type="button" value="改变标题">
</body>
</html>