HTML: Display Tooltip on Hover

HTML: Display Tooltip on Hover

  • HTML
  • 1 min read

Below is an example of HTML to display a tooltip on hover.

HTML Example: Tooltip on Hover

In the following example, the title attribute is used with the input field to display a tooltip on hover. Title specifies additional information about an element. For some elements, the title appears in a tooltip when the user hovers the mouse over the element.

<html lang="en">

<body>
    <h1>Fox Infotech</h1>
    <p> Welcome to our website.</p>
    <form action="subscribe.php" method="post">
        <p>Please enter your e-mail address to subscribe to our news letter.</p>
        <p>E-Mail:
            <input type="text" name="email" id="email" title="Enter a e-mail here.">
        </p>
        <p>
            <input type="submit" value="Subscribe">
        </p>
    </form>
</body>

</html>

Output

HTML Tooltip example.

See also: