How to add hover text without JavaScript?

Spread the love

Sometimes, we want to add hover text without JavaScript.

In this article, we’ll look at how to add hover text without JavaScript.

How to add hover text without JavaScript?

To add hover text without JavaScript, we add the title attribute.

For instance, we write

<div title="them's hoverin' words">hover me</div>

to add the title attribuute with the text for the tooltip as its value.

Then when we hover over the div, we see the tooltip show.

Conclusion

To add hover text without JavaScript, we add the title attribute.

Leave a Reply

Your email address will not be published. Required fields are marked *