How to add text or title to the browser tab using HTML?

August 27, 2021 - 1 min read

To add a text or title to the browser tab using HTML, we can use the title HTML element tag inside the head HTML element tag.

For example, consider we want to add a text called Home to the browser tab when the user visits the home page of your website.

So for that, we can use the title HTML element tag and put the text inside the opening and closing block of the title HTML tag.

It can be done like this,

<!DOCTYPE html>
<!-- Add text or title to the browser tab using the 'title' HTML element tag -->
<html>
  <head>
    <!-- 'title' tag with content of 'Home' -->
    <title>Home</title>
  </head>

  <body>
    Hello World!
  </body>
</html>

Now the browser tab text will be changed to the text Home.

See the above code live in JSBin.

That's all 😃!

Feel free to share if you found this useful 😃.