html title w3schools code example
Example 1: html title
<head>
<title>My page title</title>
</head>
<script>
document.title = "My new title";
</script>
Example 2: html title tag
<title>Website Title</title>
<head>
<title>My page title</title>
</head>
<script>
document.title = "My new title";
</script>
<title>Website Title</title>