JS控制页面的标题title
2019-11-08 本文已影响0人
Wanlly
获取或设置文档的标题
例子:
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<script>
alert(document.title); // 显示 "Hello World!"
document.title = "Goodbye World!";
alert(document.title); // 显示 "Goodbye World!"
</script>
</body>
</html>