Sử dụng document.title thuộc tính để đặt tiêu đề của tài liệu trong JavaScript.
Ví dụ
Bạn có thể thử chạy mã sau để triển khai document.title thuộc tính trong JavaScript.
<!DOCTYPE html>
<html>
<head>
<title>Demo Title</title>
</head>
<body>
<script>
var x = document.title;
document.write("Our Title: "+x);
</script>
</body>
</html>