DEV Community

Cover image for How to add text or title to the browser tab using HTML?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Originally published at melvingeorge.me

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

Originally posted here!

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,

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

  <body>
    Hello World!
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

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 😃.


Top comments (0)